关于 mysql 全文检索的分词和 wildcard
資深大佬 : xianyu0 52
需求是这样的,搜索关键字有可能是词组,期望搜索出来的结果包含整个词组(即不分词),但可以带后缀通配符。
比如:搜索 hello world
期望结果包括:
hello world
hello worlds
不包括:
hello xxx world
mysql 的全文检索通过 double quote 阻止分词,但是在 double quote 里无法使用 wildcard,
比如 match(c) against(‘”hello world*”‘ in boolean mode) 的搜索结果并不包含 hello worlds。
这个貌似是 mysql 的 bug,搜到这个 issue: https://bugs.mysql.com/bug.php?id=80723
不知是否有办法绕过(暂不考虑 elasticsearch……
大佬有話說 (6)