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
Solved! Go to Solution.
Hi @NitroHazeDev, you need to create custom index you can have a look on those pages [1], [2] for more information.
[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
Anyone please ?
Hi @NitroHazeDev, you need to create custom index you can have a look on those pages [1], [2] for more information.
[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
I would actually recommend to switch to the "type=dam:Asset" statement, as it will use a different, more suitable index.
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.
Views
Likes
Replies
Views
Likes
Replies