Hello,
for a project I have following folder structure:
/content/sites/dam/pic/0/111
/content/sites/dam/pic/0/11
content/sites/dam/pic/1/02
/content/sites/dam/pic/2/2222
The following x-path query works for me to grab the name of last subfolders with two characters in name: /jcr:root/content/sites/dam/pic/*/*/element(*,sling:OrderedFolder)[jcr:like(fn:name(),'__')]
I read lots of page whose explained the syntax and provided examples for query builder. It only accept one level of subnodes, even I set value of p.depth greater than one. My question: What is the conversion from above xpath query into one for querybuilder?
Thanks in advance.
Solved! Go to Solution.
Views
Replies
Total Likes
Created similar folder structure in DAM as shown in below screenshot -
Using xpath query , getting below result -
Here is the query builder query -
path=/content/dam/demo/pic type=sling:Folder nodename=?? p.limit=-1
Result -
Useful information has given here -
Note:- During conversion to Xpath query * is converted to % and ? is converted to _ . For Example ‘metadata%’ (metadata node is considered, will return result for metadata,metadata1,metadata2 etc) but for ‘metadata_’ (metadata node is ignored, will only return result for metadata1, metadata2). Choose your wildcards very wisely. Hope it clears your doubt.
http://www.aemcq5tutorials.com/tutorials/adobe-aem-cq5-tutorials/aem-query-builder/
Hope this will help.
Created similar folder structure in DAM as shown in below screenshot -
Using xpath query , getting below result -
Here is the query builder query -
path=/content/dam/demo/pic type=sling:Folder nodename=?? p.limit=-1
Result -
Useful information has given here -
Note:- During conversion to Xpath query * is converted to % and ? is converted to _ . For Example ‘metadata%’ (metadata node is considered, will return result for metadata,metadata1,metadata2 etc) but for ‘metadata_’ (metadata node is ignored, will only return result for metadata1, metadata2). Choose your wildcards very wisely. Hope it clears your doubt.
http://www.aemcq5tutorials.com/tutorials/adobe-aem-cq5-tutorials/aem-query-builder/
Hope this will help.
Thanks for answer. I tried it and it doesn't work either. I always get following message:
Cannot serve request to /libs/cq/search/content/querydebug.html in /libs/cq/search/components/querydebug/querydebug.jsp
java.lang.UnsupportedOperationException: The query read or traversed more than 100000 nodes. To avoid affecting other tasks, processing was stopped.
It will work if I extend the given path with additional layers until last to next. Is there a difference between "OrderedFolder" and "Folder"?
I have created sling:OrderedFolder under /content/dam/we-retail/en/pic as shown in below screenshot -
Below query is working perfectly without any issue with sling:OrderedFolder-
path=/content/dam/we-retail/en/pic type=sling:OrderedFolder nodename=?? p.limit=-1
Please share your query and folder structure so that I can review.
I could figure out that was an issue with missing content index and too many subnodes.
Views
Replies
Total Likes
By the way: Your screenshot from querybuilder debug has a tiny difference to mine. On my AEM instance there is a dropdown field right from checkbox "Extract facets" with three available options (Default, Computed, Oak). Could it be the reason why your query does not work on my instance?
I am using AEM 6.5.11. Please do share the path value in your query.