Custom Oak index not selected for queries in Adobe Experience Manager
This article explains why a custom Oak index in Adobe Experience Manager (AEM) may not be selected for certain queries and provides steps to resolve the issue.
Description description
Environments
- Adobe Experience Manager (on-premise)
- AEM as a Cloud Service (AEMaaCS)
Symptoms
A custom Oak index is often created in AEM to improve the performance of specific queries, such as those filtering by tags and ordering by published date. However, after deploying the custom index, you notice that your query continues to use the default ntBaseLucene-2 index instead of the custom one, resulting in slower query performance. This issue can occur in both AEM as a Cloud Service (AEMaaCS) and on-premise AEM deployments.
Resolution resolution
Follow the steps below to resolve the issue:
-
Review your custom Oak index definition, and check for the presence of the property
selectionPolicyset totag. -
If
selectionPolicy="tag"is present, remove this property from the index definition. Don’t change other configuration elements, such asincludedPaths,type, or indexed properties. -
Redeploy the updated index definition:
-
For AEM as a Cloud Service (AEMaaCS): Deploy the updated index package using Cloud Manager.
-
For on-premise AEM: Deploy the updated index package using your standard deployment method (such as package manager or file system deployment).
-
-
Allow AEM to reindex and activate the new index definition.
-
Use the Query Performance tool or the Explain feature to verify that your query now uses the custom index instead of
ntBaseLucene-2. -
Confirm that the query response time improves and meets your expected performance.