Can Sphinx search engine do a NOT AND filter?

喜欢而已 提交于 2019-12-13 08:02:03

问题


Suppose I have a Sphinx index with the following boolean attributes:

narrow
tall

I want to filter all the documents that are NOT (narrow AND tall).

Can this be done with Sphinx?

If it makes any difference I'm using the Python sphinxapi.py.


回答1:


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)


来源:https://stackoverflow.com/questions/29018778/can-sphinx-search-engine-do-a-not-and-filter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!