问题
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