如果我搜索术语“rexx”,那么结果将显示与搜索词相似的所有条目。例如:
Search Term: rexx Records: 1. Candyrexx 2. Paidrexx 3. PayPal Rexx 4. Rexio 5. to Rexx 6. Rexxio Result: 1, 2, 3, 5, 6
我将尝试查询SELECT * FROM user WHERE MATCH(name) AGAINST('+rexx' IN BOOLEAN MODE);
但我得到了条目(3,5,6)作为结果。结果中缺少记录 1 和 2。
最佳答案
评论太长了。仅在单词末尾支持通配符。作为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 全文搜索不(直接)支持您正在寻找的功能。您可以使用LIKE
来代替,但这通常表现更差。
关于MYSQL 全文搜索无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33236147/