在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