“显示除"以外的所有内容.在MySQL布尔全文搜索中 [英] "Show all except" in MySQL Boolean Full-Text Searches

查看:79
本文介绍了“显示除"以外的所有内容.在MySQL布尔全文搜索中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用MySQL布尔型全文本搜索...

With MySQL Boolean Full-Text Searches...

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."

除了包含任何排除的术语的行以外,是否可以进行所有行的搜索?

Is there any way to do a search giving all rows except those that contain any of the excluded terms?

like(+ * -blah -blah2)

like (+* -blah -blah2)

推荐答案

否,但这等同于简单地NOT条件:

No, but it would be equivalent to simply NOT the condition:

SELECT *
FROM foo
WHERE NOT MATCH (bar) AGAINST ('blah blah2')

当然,这样的查询实际上可能无法使用全文索引进行快速查找.

of course such a query can't possibly actually use the fulltext index for quick lookup.

这篇关于“显示除"以外的所有内容.在MySQL布尔全文搜索中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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