Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

AEM query builder , not equals condition

Avatar

Level 2

I wanted to query all the pages with below conditions

  1. should be activated pages
  2. a property(flag) should be set to false
  3. should exclude 3 templates (template a, template  b, template c)

I tried the below query for first 2 conditions, but how to include the third condition?

type=cq:PageContent
path=/content/retail
1_property=flag
1_property.value=false
2_property=cq:lastReplicationAction
2_property.value=Activate
property.and
p.limit=-1
p.hits=full

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Try with below query

 

type=cq:PageContent
path=/content/retail
1_property=flag
1_property.value=false
2_property=cq:lastReplicationAction
2_property.value=Activate
property.and
group.property=cq:template
group.property.1_value=value1
group.property.2_value=value2
group.property.3_value=value3
group.property.operation=unequals
group.property.or
p.limit=-1
p.hits=full



Arun Patidar

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Try with below query

 

type=cq:PageContent
path=/content/retail
1_property=flag
1_property.value=false
2_property=cq:lastReplicationAction
2_property.value=Activate
property.and
group.property=cq:template
group.property.1_value=value1
group.property.2_value=value2
group.property.3_value=value3
group.property.operation=unequals
group.property.or
p.limit=-1
p.hits=full



Arun Patidar

Avatar

Level 2
The template check is not happening, should we try joing the first property and group?

Avatar

Community Advisor

Try with group and query

 

type=cq:PageContent
path=/content/retail
1_property=flag
1_property.value=false
2_property=cq:lastReplicationAction
2_property.value=Activate
property.and
group.property=cq:template
group.property.1_value=value1
group.property.2_value=value2
group.property.3_value=value3
group.property.operation=unequals
group.property.and=true
p.limit=-1
p.hits=full



Arun Patidar