AEM Querybuilder - How to return only the folders under a path? | Community
Skip to main content
ksuren
Level 3
Jun 1, 2018 8:31 PM UTC
Solved

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

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-retail%2fen&type=slin…

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Jun 1, 2018 11:05 PM UTC

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

4 replies

ksuren
ksurenAuthor
Level 3
Jun 2, 2018 4:46 PM UTC

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

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Jun 1, 2018 11:05 PM UTC

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

Translate
Arun Patidar
ksuren
ksurenAuthor
Level 3
Jun 1, 2018 10:02 PM UTC

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"

Translate
smacdonald2008
Level 10
Jun 1, 2018 9:13 PM UTC

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

I have 20 components under here:

Used this query and it returned the correct results..

Translate