Open main menu

lensowiki β

Help:Short words in searches

Revision as of 05:34, 19 July 2006 by Wadmin (talk | contribs) (1 revision(s))

Changing minimum and maximum word lengths in MySQL

From MySQL's docs on Fine-Tuning MySQL Full-Text Search:

The minimum and maximum length of words to be indexed is defined by the ft_min_word_len and ft_max_word_len system variables (available as of MySQL 4.0.0). See Section 5.3.3, “Server System Variables”. The default minimum value is four characters. The default maximum depends on your version of MySQL. If you change either value, you must rebuild your FULLTEXT indexes. For example, if you want three-character words to be searchable, you can set the ft_min_word_len variable by putting the following lines in an option file (you can simply put these lines in my.cnf):

 [mysqld]
 ft_min_word_len=3

 [myisamchk]
 ft_min_word_len=3

Then restart the server

mysqladmin shutdown
mysqld_safe &

and rebuild your FULLTEXT indexes. Also note particularly the remarks regarding myisamchk in the instructions following this list.

php rebuildtextindex.php

You might want to consult this site [1] for further reference.

See also