Fulltext search for 3 char words

  • June 18, 2014
You will be surprised to know that MySQL does not index words containing 3 or less characters by default.  Searching in such words end up with no result.‚Äč

Here is the solution:

There is a system option named "ft_min_word_len" by which you can define the minimum length of words to be indexed.  You need to set value to this configuration directive in your MySQL configuration file.

If you don't want to change your configuration file there is also a handy method you can run.  Just start your mysql daemon with the following command

mysqld --ft_min_word_len=3

You may also need to rebuild your indexes after making these changes.

Now, you can search words with 3 characters in your full text queries.

How helpful was this article to you?

Posting has been disabled.