MySQL's full-text search is a powerful indexing feature that allows efficient searching within large text-based data. Osclass utilizes full-text indexing for item titles and descriptions to enhance search accuracy and performance.
While MySQL provides some tunable parameters for full-text search, modifying these settings without proper knowledge can reduce search effectiveness. Adjustments should be made carefully and with an understanding of their impact on database performance.
By default, MySQL applies the following settings for full-text indexing:
This means that words with fewer than 4 characters are not indexed, and search queries containing such words may not return expected results.
If you need to adjust the minimum and maximum lengths of words indexed by MySQL’s full-text search, update your MySQL configuration file (my.cnf
or my.ini
, depending on the system).
my.cnf
or my.ini
) in a text editor.[mysqld]
section:[mysqld]
ft_min_word_len=3
ft_max_word_len=10
In this example:
ft_min_word_len=3
– Allows words with a minimum length of 3 characters to be indexed.ft_max_word_len=10
– Limits indexed words to a maximum of 10 characters.After modifying the ft_min_word_len
or ft_max_word_len
values, MySQL requires a restart and a reindexing process to apply the changes. Simply updating the configuration file will not automatically reindex the existing data.
Follow these steps:
REPAIR TABLE tbl_name QUICK;
Replace tbl_name
with the actual name of the table containing the full-text index. For Osclass, this would typically be the listings table.
By fine-tuning MySQL's full-text search, you can improve search accuracy and better control indexing behavior in Osclass.