gpt4 book ai didi

sql - MySQL bool 全文搜索中的 "Show all except"

转载 作者:行者123 更新时间:2023-11-29 07:11:57 26 4
gpt4 key购买 nike

使用 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com