我可以在/foo
中使用 match来搜索行:bar
col1
col2
SELECT col1, col2
FROM some_table
WHERE MATCH (col1,col2)
AGAINST ('+foo +bar' IN BOOLEAN MODE);
但是假设我想搜索确切的短语“foo.bar” (中间有句号)。在Boolean Full-Text Searches 的文档页面上,它没有提到句号是运算符,所以我想我可以使用:
AGAINST ('+foo.bar' IN BOOLEAN MODE);
但是,这将返回与以下相同的结果:
AGAINST ('+foo.couldBeAnything' IN BOOLEAN MODE);
AGAINST ('+foo' IN BOOLEAN MODE);
AGAINST ('+foo.*' IN BOOLEAN MODE); #Note you would expect this to look for instances of foo. followed by something, rather than just the same as foo
.
为什么这不像我预期的那样工作?我该如何匹配 for foo.bar
?