Our highest priority is to satisfy the customer through early and continuous delivery of valuable and working software.

Wednesday, May 16, 2007

Edit MySQL stopword list [MySQL full text search]

There are two ways to edit MySQL stopword list. Actually its not editing. Its all about creating a new file with your own stopwords & point MySQL to refer to that file location.

1st option
----------

Create File: e.g. /etc/stopword.txt
* Change permission of this file, so that MySQL can read it.
* Don't put stopword file in /root, because mysql doesn't have permission to access it there.

Edit /etc/my.cnf file
Search for ft_stopword_file
Change Line ft_stopword_file=/etc/stopword.txt

Then run following command to restart MySQL.
service mysqld restart

Run MySQL command, for immediate effect of this action on any table for Full-Text search.
REPAIR TABLE table_name QUICK;

2nd option
----------
You'll need to edit the file myisam/ft_static.c. recompile MySQL, and rebuild the indexes!

See the default list of full-text stopwords @
MySQL default stopwords list