MySql全文搜索使用2个字符的单词 [英] MySql Fulltext search using 2 character word

查看:93
本文介绍了MySql全文搜索使用2个字符的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了 ft_min_word_len = 1 并运行显示像'ft%'这样的变量; 也显示相同。
也已经通过删除和重新创建Fulltext索引来更新它们。

I've set ft_min_word_len = 1 and running show variables like 'ft%'; also shows the same. Also have already updated the Fulltext indexes by dropping and re-creating them.

但是,当我运行 SELECT OriginalProductName FROM products WHERE MATCH (产品名称)对于具有Samsung Hg55nc890xf 3D 1080p Led液晶电视Hdtv的行,在返回0结果的情况下对('+ samsung + tv'IN BOOLEAN MODE);

当我执行 SELECT OriginalProductName FROM products WHERE MATCH(ProductName)AGAINST('+ samsung + led'IN BOOLEAN MODE);

我正在使用MySQL 5.6.22。 Innodb是Table引擎。

I am using MySQL 5.6.22. Innodb is the Table engine.

如何让MySql全文搜索能够搜索像电视,32,美国等2个字符的字词?

How can make MySql Fulltext search to search 2 character words like tv, 32, US etc...?

推荐答案

我发现这个问题是特定于 innodb 存储引擎的。我已经通过将
[mysqld]
innodb_ft_min_token_size = 2;
添加到 /etc/my.cnf

I found that this issue was specific to innodb storage engine. I've solved the issue by adding [mysqld] innodb_ft_min_token_size =2; to /etc/my.cnf

这篇关于MySql全文搜索使用2个字符的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆