Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Custom index validation

Avatar

Level 2

Hi,

I’m trying to optimize oak indexes in a Clou. We have a few custom queries that are running very slow, and after checking explain plans, it looks like they’re falling back to traversal. I know AEMaaCS doesn’t allow direct CRXDE changes, so indexes need to be managed via code deployments.

 

What’s the best way to properly define and deploy a custom oak:index in Cloud Service, and how can I safely test changes before pushing them through Cloud Manager? Also, are there tools or recommended steps to validate whether the new index is actually being used by queries?

 

Thanks!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @SanaQu ,

First you can try to set up a local development environment and deploy the customized indices. Ensure that the updated indices are up to date.

The local development environment for AEM can be broken up into three logical groups:

  • The AEM Project contains the custom code, configuration and content that is the custom AEM application.
  • The Local AEM Runtime which runs a local version of AEM Author and Publish services locally.
  • The Local Dispatcher Runtime which runs a local version of Apache HTTP Web Server and Dispatcher.


You can follow below links for more details on it:

https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/local-development-...

 

Once you test it on local you can move it higher environment.
For deployment purpose you can follow below link

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/index...


-Tarun

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @SanaQu,

Yes as you mentioned on a Cloud you can’t edit indexes directly - everything has to be deployed through code, and only Lucene indexes are supported. The right way to do this is:

  • Define your custom index under /oak:index in your codebase (set type=lucene).

  • If you need to change it later, don’t flip reindex=true. Instead, bump the version suffix (eg. myIndex-1 -> myIndex-2) and redeploy - Cloud Manager will do a rolling reindex for you.

  • Test queries locally with the AEM SDK using EXPLAIN to make sure they actually pick up your index and not traversal.

Adobe has good docs that walk through this: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/index...

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/query...


Santosh Sai

AEM BlogsLinkedIn


Avatar

Level 5

Hi @SanaQu 

  • Validate locally before deploying: Deploy your index definitions into the AEM SDK and use the Explain Query tool (/libs/granite/operations/content/diagnostics/query.html) to confirm the query plan is picking up your index. This avoids wasted Cloud Manager runs.
  • Use DEBUG logs for deep validation: Temporarily set org.apache.jackrabbit.oak.query to DEBUG. When you run your queries, the logs will explicitly show which index is selected. That makes it easier to confirm whether your custom index is actually being used.
  • Monitor index activity: The IndexStats MBeans (/system/console/jmx) give you visibility into indexing cycles, queue sizes, and whether your custom index is up-to-date. This can be really helpful to confirm your new index is live and not stale.
  • Index design tips: Keep indexes as narrow as possible (includedPaths, specific properties) so they stay efficient and don’t slow down background indexing. Avoid broad indexes covering the entire repository unless absolutely necessary.

Hope this helpful:)

 

Regards,

Karishma.

 

Avatar

Correct answer by
Community Advisor

Hi @SanaQu ,

First you can try to set up a local development environment and deploy the customized indices. Ensure that the updated indices are up to date.

The local development environment for AEM can be broken up into three logical groups:

  • The AEM Project contains the custom code, configuration and content that is the custom AEM application.
  • The Local AEM Runtime which runs a local version of AEM Author and Publish services locally.
  • The Local Dispatcher Runtime which runs a local version of Apache HTTP Web Server and Dispatcher.


You can follow below links for more details on it:

https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/local-development-...

 

Once you test it on local you can move it higher environment.
For deployment purpose you can follow below link

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/index...


-Tarun