Changing the minimum or maximum fulltext word length in MariaDB

Home > Search
  by

One of the issues with fulltext is that the default minimum word length returned is 4 characters.  For example, words which are 4 characters or more such as jack jill hill water will be displayed in the search results.  Words 3 characters or less will not be searched.  This is most problematic when dealing with abbreviations such as FTP (file transfer protocol) and DNS (domain name service).  To change the minimum word length to 3 character, add the following to your /etc/my.cnf file.

ft_min_word_len = 3

 

Restart MariaDB, and ensure MariaDB is active and running.

[root@server1 ~]# systemctl restart mariadb
[root@server1 ~]# systemctl status mariadb

 

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

[root@server1 ~]# 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       |
|---------------------------------------------------------|

 



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