The Query Builder is a great tool that allows us to search for nodes in the JCR. We often as AEM developers use this tool to build a query for us to use in the backend to build query descriptions (predicates); the set of predicates produced will call the Predicate Evaluator which knows how to handle that specific predicate for XPath, filtering, and facet extraction.
In this article, we will be sharing query examples to find all AEM pages with specific page page properties using the Query Builder Debugger tool.
1. Find all AEM pages with a single page property
Find all pages under /content/we-retail,
and has page properties set with cq:productMaster == ‘/var/commerce/products/we-retail/wo/pants/faba_running_pants’
show max results.
1 2 3 4 5 6 | path=/content/we-retail type=cq:Page property=jcr:content/cq:productMaster property.value= /var/commerce/products/we-retail/wo/pants/faba_running_pants p.limit=-1 |
2. Find all AEM pages with multiple page properties
Find all pages under /content/we-retail,
and has page properties set with cq:productMaster == ‘/var/commerce/products/we-retail/wo/pants/faba_running_pants’
and has page properties set with cq:template == ‘/conf/we-retail/settings/wcm/templates/product-page’
show max results.
1 2 3 4 5 6 7 8 9 10 11 | path=/content/we-retail type=cq:Page path=/content/we-retail type=cq:Page group.1_property=jcr:content/cq:productMaster group.1_property.value= /var/commerce/products/we-retail/wo/pants/faba_running_pants group.2_property=jcr:content/cq:template group.2_property.value= /conf/we-retail/settings/wcm/templates/product-page p.limit=-1 |
Find all AEM Pages with Tags with Query Builder API