gpt4 book ai didi

mysql - 为什么即使降低了 ft_min_word_len,全文搜索也不会返回短词?

转载 作者:可可西里 更新时间:2023-11-01 08:21:24 25 4
gpt4 key购买 nike

在我的 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

返回 0 条记录,尽管存在具有该确切名称 - “aaa” 的记录。我也尝试过其他的,比如“包”和(经典的)“流浪汉”。

最佳答案

你改完后有没有重启mysql?您需要重新启动并重建索引。还请记住,如果您搜索的内容出现在超过 50% 的记录中,mysql 将不会返回任何内容。这使得使用 10 条记录进行测试变得困难。

关于mysql - 为什么即使降低了 ft_min_word_len,全文搜索也不会返回短词?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7587120/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com