CQ 5.3 QueryBuilder Search Not Working as Expected | Community
Skip to main content
scribe123
New Participant
October 16, 2015
Solved

CQ 5.3 QueryBuilder Search Not Working as Expected

  • October 16, 2015
  • 2 replies
  • 822 views

Hi,

I'm trying to produce a query that will return all pages under a path where a property is NOT present.

Effectively I want the query builder query that will produce the following xpath: /jcr:root/content/site/my/path//element(*, cq:Page)[not(jcr:content/task/@finished)]

For CQ 5.3 the 'exists' property doesn't seem to be present (according to the docs: http://docs.adobe.com/docs/en/cq/5-3/javadoc/com/day/cq/search/eval/JcrPropertyPredicateEvaluator.html), however it looks like I can use 'not', so I've tried the following two examples but neither work as I expect in query debugger:

#1

path=/content/site/my/path
type=cq:Page
property=jcr:content/task/finished
property.operation=not

#2

path=/content/site/my/path
type=cq:Page
property=jcr:content/task/finished
property.operation=not
property.value=true

I've also seen pages that suggest these should work, and I can't seem to see any hotfixes that would cover fixing this (assuming it isn't actually working correctly).

Can anyone offer a solution or point out where I'm going wrong?

Using CQ 5.3, upgraded to crx 2.2.

Cheers

Chris

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 smacdonald2008

For this - i recommend using the AEM Test Query Tool:

http://cq-ops.tumblr.com/post/23543240500/how-to-use-cqs-query-debugger-tool

Try different combinations to get the correct query. 

2 replies

smacdonald2008
smacdonald2008Accepted solution
New Participant
October 16, 2015

For this - i recommend using the AEM Test Query Tool:

http://cq-ops.tumblr.com/post/23543240500/how-to-use-cqs-query-debugger-tool

Try different combinations to get the correct query. 

scribe123
scribe123Author
New Participant
October 16, 2015

I wouldn't have posted here without doing that first.