使用 MySQL bool 全文搜索...
http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html
A leading minus sign indicates that this word must not be present in any of the rows that are returned.
Note: The - operator acts only to exclude rows that are otherwise matched by other search terms. Thus, a boolean-mode search that contains only terms preceded by - returns an empty result. It does not return “all rows except those containing any of the excluded terms.”
有什么方法可以搜索除包含任何排除项的行之外的所有行吗?
喜欢 (+* -blah -blah2)
最佳答案
不,但它等同于简单地 NOT
条件:
SELECT *
FROM foo
WHERE NOT MATCH (bar) AGAINST ('blah blah2')
当然这样的查询不可能真正使用全文索引进行快速查找。
关于sql - MySQL bool 全文搜索中的 "Show all except",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3913777/