Using Search and Indexing in AEM as a Cloud Service

James Talbot
Adobe Tech Blog
Published in
3 min readFeb 24, 2021

--

AEM supports running queries against the JCR repository, which is very similar to running queries against a relational database. Full text queries are also supported. Customers can write their own queries and define their own indexes, and many AEM customers do this.

Changing the index definitions is needed to speed up queries. With blue-green deployments, the challenge is that multiple application versions can exist at the same time, but each version might require a different index configuration.

With AEM as a Cloud Service, instead of configuring and maintaining these indices on single AEM instances, the index configuration has to be specified before an actual deployment. Let’s review some of the changes in AEM as a Cloud Service:

Indexing Changes in AEM as a Cloud Service

  • Users will not have access to the Index Manager (http://localhost:4502/libs/granite/operations/content/diagnosistools/indexManager.html) of a single AEM Instance anymore to debug, configure or maintain indexing. It is only used for local development and for on-prem deployments.
  • Users will not be able to change Indexes on a single AEM Instance anymore nor will they have to worry about consistency checks, reindexing etc.
  • In general, index changes are initiated before going to production to not circumvent quality gateways in Cloud Manager CI/CD pipelines. This will also prevent impacting business KPIs in production.
  • All related metrics, including search performance in production will be available for customer users at runtime. Having these metrics will provide a holistic view on the topics of search and indexing.
  • Customers will be able to set up alerts to their needs.
  • Adobe Site Reliability engineers are monitoring the system health 24/7 and can take action as needed, and as early as possible.
  • Index configuration is changed via deployments. Index definition changes are configured like other content changes.
  • At a high level, on AEM as a Cloud Service, using the the blue-green deployment model, means there are two sets of indexes: one set for the old version (blue), and one set for the new version (green). At which version an index is used, it is configured using flags in the index definitions (“useIfExist”). An index may be used in only one version of the application (e.g. only blue, or only green), or in both versions.
  • Customers can see whether the indexing job is complete on the Cloud Manager build page and will receive a notification when the new version is ready to take traffic. Note that there is no progress bar to show how much time remains for the indexing job. At this time, there is no plan to provide a UI in Cloud Manager to view or edit index definitions.

Hands on Example

If you have an instance of AEM as a Cloud Service, and a sample project such as WKND (https://github.com/adobe/aem-guides-wknd), you can follow these steps to understand the search and indexing changes in AEM as a Cloud Service. In addition, you will prepare, add and change an index definition in AEM as a Cloud Service.

Let’s get started.

  1. Download a Custom Index Definition.
  2. Copy .content.xml to ui.content project in the Cloud Manager Git Project. The project path should look like: \ui.content\src\main\content\jcr_root_oak_index.
  3. Modify the filter.xml to include the _oak_index folder
  4. Add <allowIndexDefinitions>true</allowIndexDefinitions> to filevault-package-maven-plugin plugin configuration in Parent pom.xml.
  5. Do a local maven build and deploy.
  6. Commit the new code with index definitions to Cloud Manager Git. For more information about deploying a project to AEM as a Cloud service, see my blog post here:

https://medium.com/adobetech/deploying-a-project-to-aem-as-a-cloud-service-using-cloud-manager-and-github-desktop-2efbb09ab5b7

Additional Resources

--

--