Expand my Community achievements bar.

SOLVED

Query builder

Avatar

Level 2

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. 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

 

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

View solution in original post

3 Replies

Avatar

Community Advisor

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

Avatar

Level 2

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

Avatar

Correct answer by
Community Advisor

 

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