AEM6.3 QueryBuilder- Using groups of predicates when at least one group must satisfy all conditions

Avatar

Avatar

elizabethp60981

Avatar

elizabethp60981

elizabethp60981

13-05-2018

Hi,

I am using Query Builder to develop a search in a website. I was looking some tutorials and I cannot find many tutorials with complex queries.

I want to group my instructions with an AND predicate, and on my case I will have three groups, that has an OR predicate between then.

In resume, all the instructions of group A must satify OR all the results of group B must satisfy OR all the results of group C must satisfy

For example:

(GroupA.condition &&  GroupA.condition2 && GroupA.condition3) OR (GroupB.condition &&  GroupB.condition2 && GroupB.condition3) OR (GroupC.condition &&  GroupC.condition2 && GroupC.condition3)

PS: I am developing using Query Builder Debugger Tool

I appreciate any help

Thank you very much!

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

13-05-2018

  • group: This predicate is used to create logical conditions in your query. You can create complex conditions using OR & AND operators in different groups.  e.g:

  Example

type=nt:base

path:/content/AEM63App/en

group.1_property=jcr:created

group.1_property.value= admin

group.1_property=jcr:title

group.1_property.value=Travel

group.1_property.and=true

group.2_property=jcr:primaryType

group.2_property.value=cq:PageContent

group.p.or=true

  

  this query will return result if (jcr:created==admin AND jcr:title ==Travel ) OR (jcr:primaryType == cq:PageContent)

hope this will help.

Thanks

Arun