Site icon Osclass Documentation & Knowledge Base

Fine-Tuning MySQL Full-Text Search – Improving search

MySQL’s full-text search capability has few user-tunable parameters.

Note that full-text search is carefully tuned for the most effectiveness. Modifying the default behavior in most cases can actually decrease effectiveness. Do not alter the MySQL sources unless you know what you are doing.

For OSClass users, item title and item description have a fulltext index, that do search more efective and speed up.

The minimum and maximum lengths of words to be indexed by default is 4 (4 characters), that means, only words more or equal than 4 will be indexed.

If you like to change the minium and maxium lengths of words to be indexed, you need update your mysql config file.

[mysqld]
ft_min_word_len=3
[mysqld]
ft_max_word_len=10

Updating minium and maximum lengths of words.

After this, if you modify full-text variables that affect indexing (ft_min_word_len, ft_max_word_len, or ft_stopword_file), you must rebuild your FULLTEXT indexes after making the changes and restarting the server. To rebuild the indexes in this case, it is sufficient to do a QUICK repair operation:

mysql> REPAIR TABLE tbl_name QUICK;