AEM: How to find the nodes with property name “cus

2019-08-15 04:10发布

问题:

There are nodes which have properties but no values.

I am trying to avoid those nodes in query builder using,

path=/content/
type=cq:Page
2_property=jcr:content/customProp
2_property.operation=exists
3_property=jcr:content/customProp
3_property.operation=unequals
3_property.value=

But the empty value condition (3_property) is being ignored. How this can be achieved?

回答1:

I had the issue to search for all occurrence of a propertiy with no value. I constructed the following SQL2 Query:

SELECT * FROM [{{jcr:primaryType}}] AS ref WHERE ISDESCENDANTNODE([{{Start Path}}]) AND ref.[{{Property Name}}] = ''

In your case I think something like should work

SELECT * FROM [{{jcr:primaryType}}] AS ref WHERE ISDESCENDANTNODE([{{Start Path}}]) AND NOT(ref.[{{Property Name}}] = '')