我正在布尔模式下进行 MySQL FULLTEXT 搜索。根据手册:
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.”
确实如此。
所以我像这样使用 NOT MATCH 运算符:
SELECT COUNT(*) FROM Table WHERE MATCH (Column) AGAINST
('bar' IN BOOLEAN MODE) AND NOT MATCH (Column) AGAINST
('barbar' IN BOOLEAN MODE);
我的问题是:NOT MATCH 字段中 + 运算符的作用是什么:是
AND NOT MATCH (Column) AGAINST ('foo bar' IN BOOLEAN MODE)
相同:
AND NOT MATCH (Column) AGAINST ('+foo +bar' IN BOOLEAN MODE)
谢谢