众所周知,LIKE 太慢,但当我尝试使用 MATCH AGAINST 时,它毫无用处。
我需要一些给出结果的操作数,例如 LIKE '%part%' 当“part”是单词的一部分而不是完整的单词时。
我已经尝试过
SELECT * FROM `table` WHERE MATCH (title) AGAINST ('*part*' IN BOOLEAN MODE)
SELECT * FROM `table` WHERE MATCH (title) AGAINST ('+*part*' IN BOOLEAN MODE)
它不工作
有什么解决办法吗?
最佳答案
您只能从单词开头匹配带有通配符的单词。作为documentation解释:
*
The asterisk serves as the truncation (or wildcard) operator. Unlike the other operators, it is appended to the word to be affected. Words match if they begin with the word preceding the * operator.
关于mysql - 如何在Mysql中使用MATCH AGAINST而不是LIKE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49905399/