Search Document which have NULL OR Empty metadata using predicate

Hello,

Can we process the following request with a generic page provider

SELECT * FROM Document WHERE dc:language = '' OR dc:language IS NULL

For information I managed to look for the nulls but I don't know how to add a predicate on the empty space and especially how to add the “OR” between them.

My code :

<genericPageProvider class="org.nuxeo.elasticsearch.provider.ElasticSearchNxqlPageProvider" name="custom_search">
      <whereClause docType="CustomSearch">
        <predicate operator="IS NULL" parameter="dc:language">
          <field name="searchNullLanguage" schema="custom_search"/>
        </predicate>
        <fixedPart>
      ecm:isVersion = 0 AND ecm:isTrashed = 0 AND ecm:isProxy=0
        </fixedPart>
      </whereClause>
    <aggregates>
        ....
    </aggregates>
      <pageSize>20</pageSize>
    </genericPageProvider>

Thank you

0 votes

1 answers

1171 views

ANSWER



0 votes



Thanks Gregory Carlin for the reply

But since I'm not too familiar with the Hints, I can not always understand because in the example, we have two fields, a single operator and a single value (equivalent to: select * From Document where dc:creator = "user1" OR dc:contributors = "user1" ) while in my case we have 1 single field with two operators and two values (equivalent to select * from Document where dc:description = '' OR dc:description IS NULL ).

Can you help me more please

01/14/2021