Can Query Builder search on multi-value property NOT containing a value?

Avatar

Avatar

EricES

Avatar

EricES

EricES

26-09-2018

Is there a way to use Query Builder to find a multi-value property that does NOT containt a particular value?

For instance, we have a "language" property that is a multi-value String. Can Query Builder find a node where the language property does not contain 'en' (English)?

View Entire Topic

Avatar

Avatar

EricES

Avatar

EricES

EricES

27-09-2018

Arun - Your XPath example helped me understand why we were getting different results.

Though I'm working on a solution that uses Query Builder via the Java API, I tested this through the Query Builder Debugger. When I put these parameters into the Debugger:

path=/content/dam/subfolder

type=nt:unstructured

property=language

property.value=en

property.operation=not

here is the XPath that it generates:

/jcr:root/content/dam/subfolder//element(*, nt:unstructured)

[

not(@language)

]

Notice that it ignored "property.value".

However, when I add the additional "jcr:like" from your XPath example above and run the modified XPath query in the CRX Query tool:

not(jcr:like(@language, 'en'))

it works as expected. While it still returns nodes without the "language" property, it also includes nodes that have the "language" property but do not have an "en" value.

I am assuming that the Query Builder Java API behaves the same, translating to the same XPath query (or SQL2 equivalent) underneath.

We are using AEM 6.1 SP2. Is it possible that Query Builder in this version behaves differently than in newer version?