Changing the Minimum Search Query - MySQL Full Text Only

From Brian Nelson Ramblings
Jump to: navigation, search

Chaing the Minimum Search Query with MySQL Full Text

By default your MySQL is set to use a minimum search query of four(4) characters. But as many store owners have discovered is that sometimes you need it shorter. Setting the value to 1 would probably crash your system. For this demonstration we will set the minimum number to 3.

However, if you're using the MySQL Fulltext search engine and the Fulltext search type, you can change the minimum number or characters to a smaller value as follows:

  • Open up your my.cnf/my.conf file
vim /etc/my.cnf

or

vim /etc/mysql/my.conf
  • Add the following line anywhere in the [mysqld] portion of the configuration file.
ft_min_word_len=3
  • Save your updated configuration file
  • Now restart mysql, this can not be done without restarting the MySQL server.
service mysqld restart

Now login to your MySQL Administrator

mysql -u admin-user-name -p

Now run:

use magento-database-name;
repair table catalogsearch_fulltext quick;
\q

Now you are all set, now when you run your reindex, it might take longer as its using more words

Other Articles