Search code examples
mysqlfull-text-searchfull-text-indexing

MySql Fulltext search using 2 character word


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.

But when I run SELECT OriginalProductName FROM products WHERE MATCH (ProductName) AGAINST ('+samsung +tv' IN BOOLEAN MODE); against a row which is having "Samsung Hg55nc890xf 3d 1080p Led lcd Tv Hdtv" as value it returns 0 results.

It works as expected when I execute SELECT OriginalProductName FROM products WHERE MATCH (ProductName) AGAINST ('+samsung +led' IN BOOLEAN MODE);

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

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


Solution

  • 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