AEM Assets: Search result ordering and performance with indexTag

This article explains why search results in Adobe Experience Manager (AEM) Assets appear out of order or load slowly when using the indexTag parameter in QueryBuilder, and provides steps to ensure correct ordering and optimal performance.

Description description

When running asset searches in AEM using QueryBuilder, adding the indexTag parameter can affect both the order and speed of search results. This is because indexTag forces the query to use a specific index, which may not be configured to support ordered sorting on the requested field. Without indexTag, AEM selects the most optimal index, often resulting in correct ordering and faster responses.

Environment

Adobe Experience Manager (AEM) Assets (all versions)

Symptoms

  • Search results aren’t ordered by the newest items first, even when using orderby and orderby.sort parameters.
  • Search response times are slower when indexTag is used.
  • Without indexTag, results are correctly ordered and load faster.

Example Query Parameter Explanations

  • path: The repository path to search under (For example: /content/dam/projects)
  • type: Node type to search for (For example: dam:Asset)
  • p.offset and p.limit: Pagination controls for result set
  • p.hits: Controls the detail level of returned results
  • p.nodedepth: Depth of nodes to include in results
  • group.tagid.property and related group parameters: Filter results by specific metadata properties and values.
  • orderby: Field to sort results by (For example: publishDatetime)
  • orderby.sort: Sort direction (asc or desc)
  • p.indexTag: Forces the query to use a specific index with the given tag.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Identify the field you want to sort by in your query (For example: publishDatetime).

  2. Review the index definition associated with the indexTag you’re using:

    • In AEM, navigate to the index definitions (typically under /oak:index in CRXDE Lite).

    • Locate the index with the specified tag.

  3. Check if the index definition includes the property you want to sort by, with ordered=true (For example: ordered=true for publishDatetime).

  4. If the property is missing or not set as ordered, update the index definition:

    • Add the property to the index definition with ordered=true.

    • Save and reindex, if required.

  5. Alternatively, use an indexTag that already supports ordered sorting on your required field (For example: for general asset searches).

  6. After making changes, rerun your query, and verify that results are ordered correctly and performance is improved.

recommendation-more-help
experience-cloud-kcs-help-kbarticles