Expand my Community achievements bar.

SOLVED

CQ 5.3 QueryBuilder Search Not Working as Expected

Avatar

Level 1

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.ht...), 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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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. 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

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. 

Avatar

Level 1

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