在我的MySQL配置中,我设置了ft_min_word_len = 2
并通过快速修复重建了索引。
为了能够搜索短(3个字母)的单词,我还需要做些什么吗?
编辑:此查询
SELECT *, match(`Tournament`.`Name`) against ('aaa') as score, `Tournament`.`id` FROM `tournie`.`tournaments` AS `Tournament` WHERE 1 = 1 GROUP BY `Tournament`.`id` having score > 0.1 ORDER BY `score` desc LIMIT 20
尽管存在具有该确切名称的记录 - “aaa”,返回0条记录。我也试过其他人,比如“包”和(经典)“屁股”。
答案 0 :(得分:3)
您是否在进行更改后重启了mysql?您需要重新启动并重建索引。还要记住,如果您搜索的内容超过50%的记录,mysql将不会返回任何内容。这使得10条记录的测试变得困难。
答案 1 :(得分:0)
请确保您添加了ft_min_word_len = 2
在
1 #Vi etc/my.cnf
[mysqld]
ft_min_word_len = 2
after that
#service mysqld restart
#rebuild your index