SIM-managed index isn’t selected for queries in AEM as a Cloud Service

In Adobe Experience Manager as a Cloud Service, a Simplified Index Management (SIM) definition can be deployed successfully while queries continue to use a previous index. The query planner evaluates eligible indexes based on query restrictions, indexed properties, and estimated cost. To fix this, verify the deployment and query plan, align includedPaths, queryPaths, and index rules with the query requirements, deploy the changes through Cloud Manager, and validate the queries after indexing completes.

Description description

Environment

Adobe Experience Manager as a Cloud Service with Simplified Index Management

Issue/Symptoms

After you deploy a Simplified Index Management definition, queries continue using a previous index instead of the intended SIM-managed index.

  • Queries continue using a previous index such as cqPageLucene instead of the intended index such as cqPageContent.
  • The SIM-managed index appears in the repository, but the Query Performance Tool doesn’t select it for the relevant queries.
  • The index definition contains includedPaths and queryPaths, but the query still uses the previous index.
  • Required query properties aren’t included in the SIM-managed index rules.
  • No specific error message appears in the logs.

Cause

The query planner selects the eligible index with the lowest estimated cost. If the SIM-managed index doesn’t cover the query path or required properties, or its estimated cost is higher than the previous index, the query continues to use the previous index.

Resolution resolution

To troubleshoot the index selection, follow these steps:

  1. Run the affected query in the Query Performance Tooland review the Explain Query output.

    • Confirm which index the query uses.
    • Confirm whether the intended SIM-managed index is considered by the query plan.
    • Record the query plan and estimated costs for comparison after you update the index definition.
  2. Confirm that the SIM definition is deployed correctly.

    • Verify that the SIM definition is included in the project codebase.
    • Confirm that the Cloud Manager pipeline completed successfully.
    • Use Repository Browser to verify that the generated index definition, such as /oak:index/<sim-index-name>, exists with the expected configuration.
  3. Review the path configuration in the index definition.

    • Confirm that includedPaths covers the content that the index should contain.
    • Confirm that queryPaths covers the path restrictions used by the query.
    • Use matching values for includedPaths and queryPaths when the index should both contain and serve queries for the same content scope.
    • Note: includedPaths controls the indexed content scope, while queryPaths affects whether the index is eligible for a query with a matching path restriction.
  4. Review the index rules and properties required by the query.

    • Confirm that each property used by the query is indexed in the appropriate index rule.
    • Check properties such as jcr:content/cq:lastModified, excludeSearch, and hideFromExternalUser when the query uses them.
    • If a required property is missing, add the appropriate index rule to the SIM definition and redeploy it through the Cloud Manager pipeline.
  5. Deploy the updated index definition through the standard Cloud Managerpipeline.

    • Package the updated index definition as part of the project codebase.
    • Run the pipeline and allow the index build or reindexing process to complete.
    • Check the indexing status on the Cloud Manager build page before validating the query again.
  6. Validate query behavior after indexing completes.

    • Rerun the affected query in the Query Performance Tool.
    • Confirm that the intended SIM-managed index is selected in the Explain Query output.
    • Test a representative set of high-impact queries.
    • Compare results and ranking before and after migration, especially for queries with boosted fields such as title, description, and content.
    • Use the Query Performance Tool to check for performance regressions.
  7. Remove obsolete index definitions from the project codebase after you validate the new SIM-managed index.

    • Don’t manually delete index nodes from the repository.
    • Note: Old and new index versions can coexist temporarily during a rolling deployment while AEM as a Cloud Service prepares the new version.

Notes:

  • SIM is recommended for Page, DAM, and Audit indexes. Migration isn’t mandatory when an existing index meets your requirements and remains supported.
  • For indexes without custom query paths, such as Audit Event or a custom Email Index, include them in the migration configuration only when you intend to migrate their queries to SIM.
  • Migrate custom indexes to SIM when ongoing support and future compatibility are requirements.
recommendation-more-help
experience-cloud-kcs-help-kbarticles