What's wrong with this Solr range filter query?

前端 未结 4 709
[愿得一人]
[愿得一人] 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:55

    When you query with -startDate:[* TO *] you get documents which do not have any data for the startDate field.

    When you query for startDate:[* TO NOW/DAY+1DAY] you get documents which have a value less than or equal to NOW/DAY+1DAY in the startDate field.

    You could try -startDate:* OR startDate:[* TO NOW/DAY+1DAY]. The first part says documents that do not have a value and the second part says document having value less than or equal to NOW/DAY+1DAY in the startDate field.

提交回复
热议问题