如何使用不可用的值来筛选搜索 [英] how to filter search by values that are not available

查看:120
本文介绍了如何使用不可用的值来筛选搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目列表:

i = SearchQuerySet().models(Item)

现在, i 中的每个项目都有一个属性价格

now, each item in i has a attribute, price

我想缩小结果,其中价格信息不可用落在给定范围内

I want to narrow the result in which price information is not available along with the ones falling in a given range

i.narrow('price:( None OR [300 TO 400 ] )')

如何做? / p>

how can that be done?

推荐答案

尝试这样:

-(-price:[300 TO 400] AND price:[* TO *])

在逻辑上是相同的,它在Solr中有效。

is logically the same and it works in Solr.

这篇关于如何使用不可用的值来筛选搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆