Steve Henry Posted November 12, 2006 Share Posted November 12, 2006 How do I change the minimum word size from default (4?) to 3 for query using MATCH... AGAINST? TIA! Quote Link to comment Share on other sites More sharing options...
AndyB Posted November 12, 2006 Share Posted November 12, 2006 http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.htmlGood Luck. Quote Link to comment Share on other sites More sharing options...
Steve Henry Posted November 13, 2006 Author Share Posted November 13, 2006 Maybe someone who has actually done this wouldn't mind sharing the short version! : ) Quote Link to comment Share on other sites More sharing options...
printf Posted November 13, 2006 Share Posted November 13, 2006 You have stop the server. Then...On [b]Linux[/b] you need to find the file [b]my.cnf[/b]. On Windows you need to find the file [b]my.ini[/b]! Then below the mysql options group...[code][mysqld][/code]You add the variable=value that you want to set the minimum word length to search. So if you want to search words (3 character) or greater, your added mysql configuration file line would be...[code][mysqld]ft_min_word_len=3[/code]If you have some special words you don't ever want to be searched, (included in the index) you would create a file of those words and add (1) word per line!// mysql_stop.txt[code]becamebecausebecomebecomesbecomingbeenbeforebeforehandbeganbeginbeginningbeginsbegunbehalfbehindbeingbelowbesidebesidesbetweenbeyondboth[/code]Then place that file some where on your system. Then add the variable=value that points to that file.// windows use full path c:/path/stop.txt[code][mysqld]ft_min_word_len=3ft_stopword_file=/path/mysql_stop.txt[/code]After you have done that, use the [b]MySQL Query Browser[/b] or some other script based MySQL access application, like [b]phpMyAdmin[/b]. In [b]phpMyAdmin[/b] click on the [b]pencil (edit)[/b] under [b]Indexes[/b] where each column is listed as FULLTEXT, you will see that below the table structure! [b]Modify an index[/b], opens, just click the button (save), the reindexing will begin! You can also just delete the FULLTEXT index clicking on the [X] image in the Indexes list, then in the structure table display, click on the last image icon that has a [T] in the image, for the column you want to add the FULLTEXT index to, click it, and the indexing will begin! But don't add a index to any column you are not using!Simple stuff...Sonia Quote Link to comment Share on other sites More sharing options...
Steve Henry Posted November 13, 2006 Author Share Posted November 13, 2006 Sonia, thank you. That all makes sense. However, when I add ft_min_word_len=3 to the mysqld.cnf file, mysqld will not restart. Any ideas? Quote Link to comment Share on other sites More sharing options...
Steve Henry Posted November 13, 2006 Author Share Posted November 13, 2006 Above should be my.cnf file... not mysqld.cnf, of course. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.