AEM6.3 QueryBuilder- Using groups of predicates when at least one group must satisfy all conditions | Community
Skip to main content
elizabethp60981
Level 3
May 13, 2018
Question

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

  • May 13, 2018
  • 1 reply
  • 1875 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

arunpatidar
Community Advisor
Community Advisor
May 13, 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

Arun Patidar