在MySQL中是否会允许搜索句子而不用考虑单词的顺序,例如:搜索Europe league
匹配league Europe
,与句子相同包含3个单词...等MySQL:搜索一个句子并忽略单词的顺序
我知道我可以在编程语言进行处理并生成MySQL查询像这样:
select p.title
from post p
where p.title = 'Europe league' or p.title = 'league Europe'
order by case
when text = 'Europe league' then 1
when text = 'league Europe' then 2
end
limit 10;
但有MySQL中的自我句柄这个问题? thx
您的SQL语法错误;检查对应于你的MySQL服务器版本的手册,在'IN BOOLEAN MODE'附近使用正确的语法@Jethro – mwafi
对不起,修正了错字。在BOOLEAN MODE之前删除逗号。 – 1sloc
看来它需要MyISAM提供全文索引支持:(找不到与列列表匹配的FULLTEXT索引) – mwafi