What's wrong with this Solr range filter query?

前端 未结 4 712
[愿得一人]
[愿得一人] 2020-12-20 21:29

The following filter query returns zero results (using *:* as query):

-startDate:[* TO *] OR startDate:[* TO NOW/DAY+1DAY]

But if I filter

4条回答
  •  死守一世寂寞
    2020-12-20 21:54

    I used femtoRgon's answer and was able to construct a query that included a range and blank values.

    The following includes all docs with a StartDate on or after 1/1/2014 and all docs without a StartDate.

    (StartDate:[2014-01-01T00:00:00Z TO *]) OR (-StartDate:([* TO *]) AND *:*)
    

    The magic is (-StartDate:([* TO *]) AND *:*). This will select the docs without a StartDate.

提交回复
热议问题