Expand my Community achievements bar.

SOLVED

Query Builder OOTB Servlet multiple paths and properties

Avatar

Level 4

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=...

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Level 10

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

Avatar

Correct answer by
Community Advisor

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