Changing the fulltext stop words in MariaDB

Home > Search
  by

With a MyISAM fulltext index, there are certain stop words that will not be used in a search. For example, the words right, second, and seeing are stop words, meaning that search will not produce any results with these stop words.  Click here for a list of common stop words. Make a file that contains your preferred stop words, and add the file to the /var/www/ directory on your server. If the file that contains the stop words is named stopwords, you would add the following to your /etc/my.cnf file.

ft_stopword_file = /var/www/stopwords

 

Restart MariaDB, and ensure MariaDB is active and running.

~]# systemctl restart mariadb
~]# systemctl status mariadb

 

Type mysql -u root -p and press enter to connect to MariaDB.

~]# mysql -u root -p
Enter password:

 

Repair your fulltext index table.

repair table table_name quick

|---------------------------------------------------------|
| Table                    | Op     | Msg_type | Msg_text |
|---------------------------------------------------------|
| database_name.table_name | repair | status   | OK       |
|---------------------------------------------------------|

 

Ensure MariaDB now recognizes your stop words.

mariadb> show variables like 'ft%'
ft_boolean_syntax = + -><()~*:""&|
ft_max_word_len = 84
ft_min_word_len = 3
ft_query_expansion_limit = 20
ft_stopword_file = /var/www/stopwords

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments