Find all AEM Pages with Specific Page Properties with Query Builder API

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

http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=path%3D%2Fcontent%2Fwe-retail%0D%0Atype%3Dcq%3APage%0D%0Aproperty%3Djcr%3Acontent%2Fcq%3AproductMaster%0D%0Aproperty.value%3D%09%0D%0A%2Fvar%2Fcommerce%2Fproducts%2Fwe-retail%2Fwo%2Fpants%2Ffaba_running_pants%0D%0Ap.limit%3D-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

http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=path%3D%2Fcontent%2Fwe-retail%0D%0Atype%3Dcq%3APage%0D%0Agroup.1_property%3Djcr%3Acontent%2Fcq%3AproductMaster%0D%0Agroup.1_property.value%3D%09%0D%0A%2Fvar%2Fcommerce%2Fproducts%2Fwe-retail%2Fwo%2Fpants%2Ffaba_running_pants%0D%0Agroup.2_property%3Djcr%3Acontent%2Fcq%3Atemplate%0D%0Agroup.2_property.value%3D%09%0D%0A%2Fconf%2Fwe-retail%2Fsettings%2Fwcm%2Ftemplates%2Fproduct-page%0D%0Ap.limit%3D-1

For other ways to find AEM pages on AEM using the query builder, checkout this article ->
Find all AEM Pages with Tags with Query Builder API

Looking for Help? Or need a mentor?

If you need help to super drive your AEM career road map, you can hire me for a one-hour session on codementor.io; We can work together on a price works just for you. https://www.codementor.io/@briankasingli. I'd be happy to help you along your way to becoming a high-quality AEM full-stack engineer.

Was this post helpful?

Hello, I am an enthusiastic Adobe Community Advisor and a seasoned Lead AEM Developer. I am currently serving as an AEM Technical Lead at MNPDigital.ca, bringing over a decade of extensive web engineering experience and more than eight years of practical AEM experience to the table. My goal is to give back to the AEM Full Stack Development community by sharing my wealth of knowledge with others. You can connect with me on LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top