Reputation: 4511
I am using fulltext searching in mysql to search a database of videos I have, however when I search my videos some results will never get returned because the title I am searching for is less than the ft_min_word_len set in MySQL's settings.
mysql_query("SELECT MATCH(videoDescription) AGAINST('".$searchString."' IN NATURAL LANGUAGE MODE)
FROM videos
LIMIT ".$start.",".$end."");
I tried firing up the mysql console to change the setting, however it told me it is read only. The only possible solution I have seen is to have the setting overridden at startup with option files. How do I use option files to overwrite the ft_min_word_len to 2 at startup?
Upvotes: 2
Views: 1593
Reputation: 401152
ft_min_word_len
is a system variable, that has to be set at the startup of the MySQL server.
This can be done passing parameters on the command-line used to start MySQL, or (recommended, I'd say), using a file containing options -- generally, for example, something like /etc/my.cnf
or /etc/mysql/my.cnf
should do the trick.
For more informations about setting system variables, you can take a look at the following section of the manual :
Also, don't forget that you'll have to rebuild your fulltext index, after changing that parameter, so the new value is taken into account.
Upvotes: 5