7

I want to reset stop word list in mysql for FULLTEXT search. I have installed WAMP Server in my system which have phpmyadmin to access mysql. But I dont know how to reset stop word in phpmyadmin. Can anyone please tell me how to do that.

I also http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_ft_stopword_file read this link but don't know ho wto use this ???

hippietrail
  • 15,848
  • 18
  • 99
  • 158
djmzfKnm
  • 26,679
  • 70
  • 166
  • 227

5 Answers5

11

I assume you're using WampServer.

Click the tray icon, select MySQL, then click my.ini. The configuration file will open in notepad. Go to the end of the file and add this line (after the port line):

 ft_stopword_file=''

to disable stop words. If you want to use custom stop-word file, replace that line with:

ft_stopword_file='path/to/stopword_file.txt'

(set the path of the stopword file, of course).

After setting that line, save the configuration file (File -> Save). Then click the tray icon, select MySQL, then Service, then click Restart Service.

To Ensure that your configuration is done correctly, open phpMyAdmin in the browser, click on the Variables tab at the top, then find ft stopword file and see the values that is set to it.

Aziz
  • 20,065
  • 8
  • 63
  • 69
0

You can find a list of stop words to use here: https://dev.mysql.com/doc/refman/5.6/en/fulltext-stopwords.html. I saved this list to a file and referenced it from the MySQL config file (e.g. ft_stopword_file='path/to/stopword_file.txt').

I removed "it" and "us" from the stopword list because they mean "Information Technology" and "United States" in my problem domain.

Unfortunately, every time you change the stopword list you have to restart MYSQL and rebuild the full-text index's.

Tom
  • 14,041
  • 16
  • 64
  • 80
0

i wass having same problem. stopwords file must be included under [mysqld] section in my.ini file.

[mysqld] ft_stopword_file = 'D:/stop.txt' then

repair table tablename worked for me.

0

I have got the same problem, I don't think you have to recompile anything, I've read that you can use the mysql console SET ft_stopword_file='path/to/stopword_file.txt', that should not require restarting your server. but I don;t think it will last till the next restart, so I guess I'll try the config file, and see if it works

Omar
  • 8,374
  • 8
  • 39
  • 50
0

The list of stopwords that MySQL ships with (at least for MyISAM) can be found in MySQL's source, in myisam/ft_static.c.

Note also that these are only the 'English' stopwords. Presumably, stopwords for other languages are defined elsewhere...

You can override or disable the default stopword list using the ft_stopword_file directive as pointed out in the comments. Full documentation here.

thomasrutter
  • 114,488
  • 30
  • 148
  • 167
  • I want to know how to disable or change the stop word list. That is not given in the article.... – djmzfKnm Apr 28 '09 at 08:48
  • You don't - you just need to add/edit my.conf. To use your own custom stopwords.txt: ft_stopword_file='path/to/stopword_file.txt' or to disable: ft_stopword_file="" You will need to rebuild your indexes though, using REPAIR or by dropping and readding them. – snipe Sep 04 '12 at 20:51