Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

Problem with QueryBuilder and path

Avatar

Level 1

Hi,

I tried to fetch informations from the repository using the QueryBuilder.
I could reproduce my problem with the servlet.

When I enter this URL :
http://localhost:4502/bin/querybuilder.json?path=/content/geometrixx/en/products/triangle&type=cq:Pa...

It returns 2 results : Features and Overview.

But I would like the query to also return Triangle which is a cq:Page.

Can you help me plz ?

Thanks.

1 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Employee

Hi

When you use path=/content/geometrixx/en/products/triangle, it searches pages under the triangle node. If you want the query to return Triangle, you have to use a different path: http://localhost:4502/bin/querybuilder.json?path=/content/geometrixx/en/products&type=cq:Page.

But of course the query will then return more results.

Lösung in ursprünglichem Beitrag anzeigen

5 Antworten

Avatar

Level 2

I think the correct way to solve this problem would be adding one more parameter:

path.self=true

So your query would be:

http://localhost:4502/bin/querybuilder.json?path=/content/geometrixx/en/products/triangle&type=cq:Pa...

Avatar

Korrekte Antwort von
Employee

Hi

When you use path=/content/geometrixx/en/products/triangle, it searches pages under the triangle node. If you want the query to return Triangle, you have to use a different path: http://localhost:4502/bin/querybuilder.json?path=/content/geometrixx/en/products&type=cq:Page.

But of course the query will then return more results.

Avatar

Level 1

Ok, so you confirm what I though, that's not possible.
Then I'll search for the element below cq:Page, which is cq:PageContent.

http://localhost:4502/bin/querybuilder.json?path=/content/geometrixx/en/products/triangle&type=cq:Pa...

Thank you.

Avatar

Employee

Yes that's the way to go if you really want to do that.

cq:PageContent properties are in jcr:content nodes and there is one below each cq:Page.

Avatar

Level 1

I finally got it working by adding another Predicate : path.self=true.

http://localhost:4502/bin/querybuilder.json?path=/content/ethias-sd1/fr/cdc-home/vehicules&type=cq:P...