how to filter search by values that are not available

后端 未结 5 2366
逝去的感伤
逝去的感伤 2021-02-20 06:11

I have a list of items as:

i = SearchQuerySet().models(Item)

now, each item in i has a attribute, price

I wan

5条回答
  •  囚心锁ツ
    2021-02-20 06:49

    As per the SolrQuerySyntax

    Pure Negative Queries:

    -field:[* TO *] finds all documents without a value for field

    You can try:

    q=(*:* -price:[* TO *]) OR price:[300 TO 400]

提交回复
热议问题