Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AEM OAK Query- Indexing

mjb54261515
Level 5
Level 5

Hello, I have custom Indexing for my project. Currently I am manually running this indexing and it works fine. Is there a way to do this automated or using scheduler. Please let me know  your inputs

6 Replies
Vish_dhaliwal
Employee
Employee

Hello,

Is this Async index?

Async indexing jobs are by default configured to run at an interval of 5 seconds which can be configured via the OSGi config -> org.apache.jackrabbit.oak.plugins.index.AsyncIndexerService.

Regards,

Vishu

jbrar
Employee
Employee

If you are changing the index definition, then you need to manually reindex it otherwise incremental indexing is performed based on the type of index:

async -> Every 5 Seconds

fulltext-aync -> Every 5 seconds

nrt -> Real-time index update with no delays

Also, Changing the "Async Indexer Configs" at "OSGi config -> org.apache.jackrabbit.oak.plugins.index.AsyncIndexerService" will have a performance impact if you change it to less than 5 and you might not get expected results if you change it to more than 5 as almost every AEM console uses aync,fulltext-aync index types.

This config should only be changed if recommended by Adobe Engineer after analyzing the complete use case.

Vish_dhaliwal
Employee
Employee

Hello,

Why do you need to run indexing manually at first place?

mjb54261515
Level 5
Level 5

Yes I updated my custom index to async. I dont know we have osgi config-> org.apache.jackrabbit.oak.plugins.index.AsyncIndexerService

Is there away to validate the that AsyncIndexerService completed re-indexing for my custom index. in logs ?

Thank you

jbrar
Employee
Employee

Please ignore the "AsyncIndexerService" config as it is not applicable here. You can setup a DEBUG logger on the following classes to capture more info about index updates to your custom index:

  • org.apache.jackrabbit.oak.plugins.index
Vish_dhaliwal
Employee
Employee

Yes, I provided the config to let you know how the indexer service is configured by default.

To check the Async index stats, you can leverage IndexStats mbean http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3Dasync%2Ctype%3DIndexStat...

But this will not provide informaiton specifically about your custom index.

Debug level logs for the appender: org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate and org.apache.jackrabbit.oak.plugins.index.IndexUpdate might be helpful to know whats happening with reindexing.  This would really fill up logs though.