adobejcraem

QueryBuilder and path


I'm using Adobe AEM, and I can't fetch the informations I want from the repository with 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.


Solution

  • This is because, Querybuilder would search only the subtree if the path property alone is set.

    In case you want to include the given path too in the search, then you need to add path.self=true to the request.

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

    For more info on Path Predicate, refer this (updated link).