content fragments dam:Asset dam:AssetContent traversing queries optimize
I have tried below two queries to return content fragments below certain dam path.
On explain query tool I see queries "no indexes used".
query1:
/jcr:root/content/dam/test/footnote-1//element(*, dam:AssetContent)
query2:
/jcr:root/content/dam/test/footnote-1//element(*, dam:Asset)
can some one suggest what is wrong with above two queries, why not any index used ( there is dam:Asset index out of the box and I was expecting to be used /oak:index/damAssetLucene )
I might be missing something here. logs on query
org.apache.jackrabbit.oak.query.QueryImpl Traversal query (query without index): select [jcr:path], [jcr:score], * from [dam:AssetContent] as a where isdescendantnode(a, '/content/dam/test/footnote-1') /* xpath: /jcr:root/content/dam/test/footnote-1//element(*, dam:AssetContent) */ union select [jcr:path], [jcr:score], * from [dam:AssetContent] as a where isdescendantnode(a, '/content/dam/test/footnote-2') /* xpath: /jcr:root/content/dam/test/footnote-2//element(*, dam:AssetContent) */; consider creating an index
Thanks,
Sri