Knowledge Base

How to change ft_min_word_len variable

Article ID: 273
Last updated: 17 Jun, 2019

Normally it is not recommended to change variables that control MySQL fulltext index behaviour (such as ft_min_word_len or ft_max_word_len) but if you really need to...

MySQL config file would usually be found on Windows under C:\Windows\my.ini and on Linux under /etc/my.cnf Edit the file and add

ft_min_word_len = 3

The default value is 4 and the above will change it to 3. You can change ft_max_word_len in the same manner:

ft_max_word_len = 150

After changing the variable(s) in config file restart MySQL server and you're done. You can then check the values in phpMyAdmin under "Show MySQL system variables" to make sure your changes have taken place.

And finally rebuilt fulltext index by running following sql:
(replace prefix for your tables if required  kbp_kb_entry -> your_prefix_kb_entry)

REPAIR TABLE kbp_kb_entry, kbp_kb_comment, kbp_kb_rating_feedback, kbp_feedback, kbp_file_entry,  kbp_news;

Check variable:

SHOW VARIABLES LIKE 'ft_min_word_len';

Article ID: 273
Last updated: 17 Jun, 2019
Revision: 3
Access: Public
Views: 34154
Comments: 0