> @Override
> protected void doPost(
> SlingHttpServletRequest request,
> SlingHttpServletResponse response
> ) throws ServletException, IOException {
>
> // [...]
> Resource resource = request.getResource();
> Node node = resource.adaptTo(Node.class);
> node.setProperty("x", "y");
> node.getSession().save();
> // [...]
>
> }
The code looks fine to me, although I'd advise just using the Resource
API if possible, since you already have the resource at hand.
>
> Now, through debugging, I have noticed that the change I made above did
> not update Jackrabbit's index. Before I try to write up a reproducible
> test case:
Is that the Lucene index? Or is the property not updated at all?
> 1. Is this a known issue?
> 2. Am I misusing API (e.g. session.save())?
See above, I think it's fine.
Robert
>
> I've noticed that Sling's PostOperation uses ResourceResolver.commit(),
> although that doesn't seem to make the difference.
>
> Cheers
> Lukas
>