Problem with QueryBuilder and path | Community
Skip to main content
p_06317
October 16, 2015
Solved

Problem with QueryBuilder and path

  • October 16, 2015
  • 5 replies
  • 1183 views

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:Page

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.

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 gcarlino

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.

5 replies

Level 2
October 16, 2015

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:Page&path.self=true

gcarlino
Adobe Employee
gcarlinoAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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.

p_06317
p_06317Author
October 16, 2015

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:PageContent

Thank you.

gcarlino
Adobe Employee
Adobe Employee
October 16, 2015

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.

p_06317
p_06317Author
October 16, 2015