Reputation: 13
How can I get results in the query builder snippet below that the industries page property has a value? (i.e., its value is not an empty string)
path=/content/apps
type=nt:unstructured
property=industries
property.value=
Upvotes: 1
Views: 4768
Reputation: 9281
You can use the like
operation for using the [jcr:like xpath function][1]
path=/content/apps
type=nt:unstructured
property=industries
property.value=%_%
property.operation=like
The corresponding xpath query would be
/jcr:root/content/apps//element(*, nt:unstructured)
[
(jcr:like(@industries, '%_%'))
]
Quoting the docs
As in SQL, the character ‘%’ represents any string of zero or more characters, and the character ‘_’ (underscore) represents any single character.
Please note that if the value contains a space alone, it is still considered valid as this function doesn't trim and then validate. Only if there is no value then it is excluded from the results.
Upvotes: 3