You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Dawid Cokan <da...@gmail.com> on 2020/01/28 13:44:19 UTC

Oak doesn't reindex lucene indexes - AsyncIndexUpdate is not ran

Hi all,

We built application using OSGi framework and we use the jackrabbit oak
1.6.17 to store some content. We have just enabled lucene indexes for full
text search. We configured them accordingly to documentation and search
works correctly. When I add new content the lucene index is updated as
commit hook and new items can be seen in search results. However after
restarting the server search is returning no results. I noticed that after
restart my index is marked to be reindexed by OAK but it seems it doesn't
happen - property reindex is never set back to false. While debugging the
code I can see that instance of AsyncIndexUpdate which performs async
reindexing is properly registered to ServiceRegistry but gets never invoked.

I analysed the code and the only code that possibly could execute that
service is a service tracker -
org.apache.jackrabbit.oak.run.osgi.RunnableJobTracker - which comes with
oak-pojosr. Indeed when adding a oak-pojosr to our dependencies and
starting that service tracker issue is solved. However I don't understand
why should I add oak-pojosr to our environment since oak-pojosr is intended
to mimic OSGi behaviour and as per my understanding should be used in case
of running in non OSGi environment which is not our case.

Best Regards, Dawid

Re: Oak doesn't reindex lucene indexes - AsyncIndexUpdate is not ran

Posted by Robert Munteanu <ro...@apache.org>.
Hi David,

On Tue, 2020-01-28 at 14:44 +0100, Dawid Cokan wrote:
> Hi all,
> 
> We built application using OSGi framework and we use the jackrabbit
> oak
> 1.6.17 to store some content. We have just enabled lucene indexes for
> full
> text search. We configured them accordingly to documentation and
> search
> works correctly. When I add new content the lucene index is updated
> as
> commit hook and new items can be seen in search results. However
> after
> restarting the server search is returning no results. I noticed that
> after
> restart my index is marked to be reindexed by OAK but it seems it
> doesn't
> happen - property reindex is never set back to false. While debugging
> the
> code I can see that instance of AsyncIndexUpdate which performs async
> reindexing is properly registered to ServiceRegistry but gets never
> invoked.
> 
> I analysed the code and the only code that possibly could execute
> that
> service is a service tracker -
> org.apache.jackrabbit.oak.run.osgi.RunnableJobTracker - which comes
> with
> oak-pojosr. Indeed when adding a oak-pojosr to our dependencies and
> starting that service tracker issue is solved. However I don't
> understand
> why should I add oak-pojosr to our environment since oak-pojosr is
> intended
> to mimic OSGi behaviour and as per my understanding should be used in
> case
> of running in non OSGi environment which is not our case.

You're right, PojoSR should not be required and is only needed when
running outside of OSGi environments.

I don't have an answer to your question, but maybe looking on how we
use Oak in Apache Sling can point you in the right direction.

You will find all bundles/configs listed under [1] and the repository
is set up using the bundle from [2]

Hope this helps,
Robert


[1]: https://github.com/apache/sling-org-apache-sling-starter/tree/master/src/main/provisioning
[2]: https://github.com/apache/sling-org-apache-sling-jcr-oak-server