Query builder | Community
Skip to main content
May 18, 2021
Solved

Query builder

  • May 18, 2021
  • 2 replies
  • 1585 views

Hi All,

 

I have a requirement to get all the PDF assets from dam (general folder). Following is the folder structure pattern where <schoolcode> is a 5 digit number (could be more than 1500 codes).

/content/dam/anc/school/<schoolcode>/general/

/content/dam/anc/school/<schoolcode>/misc/

I am using AEM 6.5. 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

 

path=/content/dam/anc/schools/ type=dam:Asset nodename=*.pdf property=jcr:content/cq:tags property.value=infrastructure:school-document-types/asbestos-register orderby=nodename p.hits=-1

 

2 replies

Vijayalakshmi_S
May 18, 2021

Hi @lalitha_j,

Given the folder structure that you shared in original query + requirement, we need to have any specific identifier for PDFs available under General folder.
Eg : Let say, via tags where those PDFs are tagged as General.
With that, we can introduce an additional property predicate to bring in General PDFs for all school codes.

 

Example : You will be able to use the path predicate value till school node.
This will bring in PDFs of all category from all school codes. Try to see/identify any specific property (with respect to General category for the PDFs) and add it along with this predicates to narrow down to exact/expected search results.


path=/content/dam/anc/school
type=dam:Asset
nodename=*.pdf

Lalitha_jAuthor
May 19, 2021

Hi @vijayalakshmi_s,

 

Thanks for your reply.

I added tag - "anc:school-document-types/general" to all the documents in the general folder for all the school codes. This value is getting saved as cq:tags property in jcr:content/metadata node. So I tried execute the following query but no luck, its returning documents in all the folders.

 

path: /content/dam/anc/schools/
type: dam:Asset
nodename=*.pdf
fulltext.relPath=jcr:content/@cq:tags
tagid: infrastructure:school-document-types/asbestos-register
orderby:nodename

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
May 19, 2021

 

path=/content/dam/anc/schools/ type=dam:Asset nodename=*.pdf property=jcr:content/cq:tags property.value=infrastructure:school-document-types/asbestos-register orderby=nodename p.hits=-1

 

Arun Patidar