MySQL全文搜索不能使用超过1个单词

时间:2013-06-06 17:52:40

标签: php mysql full-text-search

SQL:

SELECT *, MATCH(NAZOV, POPIS, CENA) AGAINST ('+htc +one') as Score
FROM `produkty`
WHERE MATCH (NAZOV, POPIS, CENA) AGAINST ('+htc +one')
ORDER BY `TOP` DESC LIMIT 0, 9

.htaccess重写搜索网址:

/vyhladavanie/+htc+one+/

如果我搜索1个单词(例如HTC)就行了!

如果我搜索1个以上的单词(例如HTC One)不能正常工作!为什么呢?

1 个答案:

答案 0 :(得分:1)

SELECT * FROM `produkty` WHERE MATCH (NAZOV, POPIS, CENA) AGAINST('+htc +one' IN BOOLEAN MODE) ORDER BY `TOP` DESC LIMIT 0, 9

试试这个