How to search for documents that have a list property empty ?

Like documents having no value in the dc:subjects field.

0 votes

1 answers

1135 views

ANSWER

Also, how about searching for documents with no subjects OR with subject 'X'.

So give me the documents that have subject X or no subject at all.

04/24/2014



You can use the following query for this:

SELECT * FROM Document WHERE dc:subjects/* IS NULL

Adding the usual filters on deleted documents or versions:

SELECT * FROM Document WHERE dc:subjects/* IS NULL AND ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState != 'deleted'

If the question is about the User Interface and the default forms displayed by Nuxeo (in the FacetedSearch for example), then you must override the search or add you own (Content-View in Studio, with the “Faceted Search” box checked), because by default, Nuxeo handles the empty parameters of these layouts as if they where not filled at all.

1 votes



It works ! Thank you very much !

You mught consider adding this case to the documentation page :

http://doc.nuxeo.com/display/public/NXDOC/NXQL

04/25/2014

Good idea. Just did it today thanks
05/19/2014