Sphinx搜索引擎可以执行NOT AND过滤器吗? [英] Can Sphinx search engine do a NOT AND filter?
本文介绍了Sphinx搜索引擎可以执行NOT AND过滤器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有一个具有以下布尔属性的Sphinx索引:
Suppose I have a Sphinx index with the following boolean attributes:
narrow
tall
我要过滤所有NOT (narrow AND tall)
的文档.
这可以用Sphinx完成吗?
Can this be done with Sphinx?
如果有什么不同,我正在使用Python sphinxapi.py
.
If it makes any difference I'm using the Python sphinxapi.py
.
推荐答案
好的,使用属性,您可以创建虚拟"属性,然后对其进行过滤.
Ok, with attributes, you can create a 'virtual' attribute and then filter on that.
.setSelect("*, (tall=1)+(narrow=1) as tallnarrow")
.setFilter("tallnarrow", [2], true)
这篇关于Sphinx搜索引擎可以执行NOT AND过滤器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文