Expand my Community achievements bar.

SOLVED

AEM Querybuilder - How to return only the folders under a path?

Avatar

Level 3

I'm trying to rerun only the folders from a given path using query builder on AEM

Query:

path=/content/dam/we-retail/en

type=sling:OrderedFolder

p.hits=selective

p.nodedepth=1

p.limit=-1

Or URL

http://localhost:4502/bin/querybuilder.json?p.hits=selective&p.limit=-1&path=%2fcontent%2fdam%2fwe-r...

Screen Shot 2018-06-01 at 3.24.43 PM.png

Screen Shot 2018-06-01 at 3.25.56 PM.png

The query returns 35 records, while there are only 6 folders under /content/dam/we-retail/en. How can i return only these 6?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You use below query

type=nt:base

path=/content/dam/we-retail/en

property=jcr:primaryType

property.1_value=sling:OrderedFolder

property.2_value=sling:Folder

path.flat=true

p.hits=selective

p.properties=jcr:path

add more value for property like property.X_value if you want to include more types.

Thanks

Arun



Arun Patidar

View solution in original post

4 Replies

Avatar

Level 10

I tested this -- ocalhost:4502/libs/cq/search/content/querydebug.htm

I have 20 components under here:

20Components.png

Used this query and it returned the correct results..

22Components.png

Avatar

Level 3

I'm looking to return folders and using "sling:OrderedFolder" or "sling"Folder", query returning sub-folders also. I wanted only top level under "/content/dam/we-retail/en"

Screen Shot 2018-06-01 at 5.00.30 PM.png

Avatar

Correct answer by
Community Advisor

Hi,

You use below query

type=nt:base

path=/content/dam/we-retail/en

property=jcr:primaryType

property.1_value=sling:OrderedFolder

property.2_value=sling:Folder

path.flat=true

p.hits=selective

p.properties=jcr:path

add more value for property like property.X_value if you want to include more types.

Thanks

Arun



Arun Patidar

Avatar

Level 3

Works like a charm.. thanks arunp99088702​ , saved me a ton of time!