开发者

MATCH() AGAINST() issues

I have a mysql query as follows:

SELECT *, MATCH(songtitle) AGAINST('{keyword}') as Relevance FROM links WHERE approved = "true" AND MATCH(songtitle) AGAINST('{keywor开发者_C百科d}' IN BOOLEAN MODE) ORDER BY Relevance DESC, score DESC LIMIT 5

This works generally as expected, but for certain queries it will not return the right results. It would appear to have to do with the length or alphanumeric makeup of the keyword used.

For example, I have a row where the value of songtitle is "Jay Z". I also have several containing the name "Jay Sean"

Searching for "Jay" or "Jay Z" does not return any of these results. Searching for "Jay Sean" has the expected and desired result.

I'm guessing this has something to do with the small amount of characters in "Jay" and "jay z"?

Any info out there about this?

Thanks! Dave


The variable you're looking for is ft_min_word_len, see http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html Rebuild your indexes afterwards.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜