FtFind - Change minimum word length to be indexed


Why?

By default, MySQL only indexes words with a minimum length of 4.

Although this is a good choice for common searches, it might be a problem when searching for technical terms. Such terms are often short acronyms like "FTP" or "MX", which cannot be found with the default setting of 4.

The minimum word length to be indexed is controlled by a server variable, i. e. this setting affects full text search indexes of all databases on this server. Further more, already exisiting databases with full text search indexes have to be "repaired" in order to make a new setting actually work.


Change server setting

The minimum word length to be indexed is controlled by server variable "ft_min_word_len". To change its value, you can add it to your my.ini setup file, e. g. by WinMySQLadmin:

After saving the new setting with the "Save Modification" button, you have to stop and restart the MySQL server to actually make it work.


Update already existing databases

After changing the "ft_min_word_len" setting, the new value will only work for new databases and tables. Any full text search indexes created before changing that value require a "quick repair".

For a FtFind database named "ftf_default", the following steps are required:

C:\Program Files\mysql\bin> mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 4.0.20a-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> USE ftf_default
Database changed

mysql> REPAIR TABLE tTexts QUICK;
+--------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+--------------------+--------+----------+----------+
| ftf_default.ttexts | repair | status | OK |
+--------------------+--------+----------+----------+
1 row in set (6.09 sec)

mysql> quit
Bye

C:\Programme\mysql\bin>

 


FtFind Home  -  Help Index  -  Copyright © 2004 by Jürgen Haible (www.elbiah.de)