Query Builder OOTB Servlet multiple paths and properties | Community
Skip to main content
Level 4
April 30, 2019
Solved

Query Builder OOTB Servlet multiple paths and properties

  • April 30, 2019
  • 2 replies
  • 2666 views

Hi All,

I am able to search with in a path for multiple properties with OR condition group predicate (Search with path if prop1 or prop2 exists)

http://localhost:4502/bin/querybuilder.json?path=/content/app/path&group.p.or=true&group.1_property=color&group.1_property.operation=exists&group.2_property=font&group.2_property.operation=exists&p.hits=full&p.limit=-1

But the correct syntax is not known for multiple paths and properties (Search with path1 or path2 if prop1 or prop2 exists). Reference document for predicates gives a way to specify nested groups but for multiple properties not sure.

group.p.or=true

group.1_group.path=/content/geometrixx/en

group.1_group.type=cq:Page

group.2_group.path=/content/dam/geometrixx

group.2_group.type=dam:Asset

Any pointers would be helpful. Thank you.

Sandeep

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 arunpatidar

you can divide your search criteria into multiple groups, let's say group1 for the property, group2 for path and group3 for type

and apply AND group operation.

Please check below query :

group.1_group.1_property=color

group.1_group.1_property.operation= exists

group.1_group.2_property=font

group.1_group.2_property.operation= exists

group.1_group.p.or=true

group.2_group.1_path=/content/geometrixx/en

group.2_group.2_path=/content/dam/geometrixx

group.2_group.p.or=true

group.3_group.1_type=cq:Page

group.3_group.2_type=dam:Asset

group.3_group.p.or=true

group.p.and=true

2 replies

smacdonald2008
Level 10
April 30, 2019

Lokesh - a top AEM Community member - addresses correct way to handle this use case here: Best practice to query JCR data using QueryBuilder API

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
April 30, 2019

you can divide your search criteria into multiple groups, let's say group1 for the property, group2 for path and group3 for type

and apply AND group operation.

Please check below query :

group.1_group.1_property=color

group.1_group.1_property.operation= exists

group.1_group.2_property=font

group.1_group.2_property.operation= exists

group.1_group.p.or=true

group.2_group.1_path=/content/geometrixx/en

group.2_group.2_path=/content/dam/geometrixx

group.2_group.p.or=true

group.3_group.1_type=cq:Page

group.3_group.2_type=dam:Asset

group.3_group.p.or=true

group.p.and=true

Arun Patidar