Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

AEM 6.4 Query Index Traversal warning

Avatar

Level 10

Running the below query throws error [2]. Is it the like operator causing trouble? Do we know how i could avoid traversal warning?

Explain query throws a 150000 traversal limit error.

 

path = /content/dam/en/we-retail
type= nt:unstructured
1_property=metadata/@dc:format
1_property.operation = like
1_property.value = image/%
p.limit =-1

 

[2]

GET /libs/cq/search/content/querydebug.html HTTP/1.1] org.apache.jackrabbit.oak.query.QueryImpl Traversal query (query without index): select [jcr:path], [jcr:score], * from [nt:unstructured] as a where [metadata/dc:format] like 'image/%' and isdescendantnode(a, '/content/dam/we-retail/en') /* xpath: /jcr:root/content/dam/we-retail/en//element(*, nt:unstructured)[(jcr:like(metadata/@dc:format, 'image/%'))] */; consider creating an index

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @NitroHazeDev, you need to create custom index you can have a look on those pages [1], [2] for more information.

[1] https://experienceleague.adobe.com/docs/experience-manager-65/deploying/practices/best-practices-for...

[2] https://jackrabbit.apache.org/oak/docs/query/lucene.html

You can also consider to change your query in the way it will use some OOTB index, e.g

path=/content/dam/we-retail/en
type=dam:Asset
1_property=jcr:content/metadata/dc:format
1_property.operation=like
1_property.value=image/%
p.limit=-1 

 

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

Hi @NitroHazeDev, you need to create custom index you can have a look on those pages [1], [2] for more information.

[1] https://experienceleague.adobe.com/docs/experience-manager-65/deploying/practices/best-practices-for...

[2] https://jackrabbit.apache.org/oak/docs/query/lucene.html

You can also consider to change your query in the way it will use some OOTB index, e.g

path=/content/dam/we-retail/en
type=dam:Asset
1_property=jcr:content/metadata/dc:format
1_property.operation=like
1_property.value=image/%
p.limit=-1 

 

Avatar

Employee Advisor

I would actually recommend to switch to the "type=dam:Asset" statement, as it will use a different, more suitable index.

Avatar

Level 10

Thanks @Jörg_Hoh .This along with @lukasz-m 's response helped. Much appreciated. Using OOTB index. I have always wondered, what are the ways to identify what index I have to create? Also, please let me know the steps if there are any for debugging this.

Avatar

Employee Advisor

Hi @NitroHazeDev ,

The property indexes are easiest to use if your query is only going to deal with limited properties (however, type of index solely depends on its complexity, use & frequency)and you can use the Explain Query tool in AEM to check if the correct index is being picked up while query is executed.

Please refer query troubleshooting guide to get deeper insights and understanding the impact of the query.

Thanks.