Custom vs OOTB index

At times, you must create custom indexes to support your search requirements. However follow below guidelines before creating custom indexes:

  • Understand the search requirements and check if the OOTB indexes can support the search requirements. Use Query Performance Tool, available at local SDK and AEMCS via the Developer Console or https://author-pXXXX-eYYYY.adobeaemcloud.com/ui#/aem/libs/granite/operations/content/diagnosistools/queryPerformance.html?appId=aemshell.

  • Define an optimal query, use the optimizing queries flow chart and JCR Query Cheat Sheet for reference.

  • If the OOTB indexes cannot support the search requirements, you have two options. However, review the Tips for Creating Efficient Indexes

    • Customize the OOTB index: Preferred option as it is easy to maintain and upgrade.
    • Fully custom index: Only if the above option does not work.

Customize the OOTB index

  • In AEMCS, when customizing the OOTB index use <OOTBIndexName>-<productVersion>-custom-<customVersion> naming convention. For example, cqPageLucene-custom-1 or damAssetLucene-8-custom-1. This helps to merge the customized index definition whenever the OOTB index is updated. See Changes to Out-of-the-Box Indexes for more details.

  • In AEM 6.X, the above naming does not work, however simply update the OOTB index with necessary properties in the indexRules node.

  • Always copy the latest OOTB index definition from the AEM instance using the CRX DE Package Manager (https://experienceleague.adobe.com/crx/packmgr/?lang=en), rename it and add customizations inside the XML file.

  • Store index definition into the AEM project at ui.apps/src/main/content/jcr_root/_oak_index and deploy it using Cloud Manager CI/CD pipelines. See Deploying Custom Index Definitions for more details.