AD0-E137 practice question 2 of 10

A customer added a custom property "foo:bar" to all assets. Once the property is added, the customer needs to run the following query: select * from [dam:Asset] where isdescendantnode('/content') and [foo:bar] ="Hello" How would the customer update the indexes to make sure the query is not a traversal query?

Full set: 50 questions
Answer options
A: Add "foo:bar" as a child node of oak:index/damAssetLucene/indexRules/dam:Asset/properties. Correct answer
B: Add "foo:bar" as a child node of oak:index/lucene/indexRules/dam:Asset/properties.
C: Add "Hello" as a child node of oak:index/ntBaseLucene/indexRules/dam:Asset/properties.
Correct Answer:
A. Add "foo:bar" as a child node of oak:index/damAssetLucene/indexRules/dam:Asset/properties.
Explanation

To make a query on a custom property performant and avoid repository traversal, the property must be added to an Apache Oak index definition. The query specifically targets nodes of type dam:Asset. AEM provides a specialized, out-of-the-box Lucene index for assets located at /oak:index/damAssetLucene. The correct procedure is to overlay this index definition and add a new property node representing the custom property (foo:bar) under the path indexRules/dam:Asset/properties. This configuration instructs the damAssetLucene indexer to include the foo:bar property in the index, allowing the query engine to resolve the constraint efficiently.

Why Incorrect

B. Modifying the generic /oak:index/lucene index is not the best practice. The damAssetLucene index is specifically configured and optimized for dam:Asset nodes.
C. This is incorrect because the node added to the index definition must be named after the property (foo:bar), not its value (Hello).

References

1. Adobe Experience League, "Best Practices for Queries and Indexing": This document outlines the need to customize indexes for custom properties. It states, "The OOTB index damAssetLucene has most of the common properties... If you are querying for a property that is not in the OOTB list, add it to the list under .../damAssetLucene/indexRules/dam:Asset/properties." This directly supports adding the custom property to the damAssetLucene index structure as described in option A.

Source: Adobe Experience League Documentation, Best Practices for Queries and Indexing. Section: "Customizing the damAssetLucene Index".

2. Adobe Experience League, "Oak Queries and Indexing": This guide details the structure of Lucene index definitions in AEM. It shows that to index a property for a specific node type, a node representing the property must be created under /oak:index//indexRules//properties. This confirms the hierarchical path used in option A is the correct method for adding a property to an index rule.

Source: Adobe Experience League Documentation, Oak Queries and Indexing. Section: "Lucene Index".

3. Apache Oak Documentation, "Lucene Index": The official Oak documentation specifies the structure for Lucene property indexes. It details that the indexRules node contains child nodes for each indexed jcr:primaryType, which in turn contain a properties node where individual property configurations are defined. This foundational documentation validates the structure indexRules/dam:Asset/properties for defining an indexed property on a dam:Asset.

Source: Apache Jackrabbit Oak Documentation, Query -> Lucene Index. Section: "Index Definition Structure".

Scroll to Top