DO YOU NEED A CONTENT WRITER FOR YOUR BUSINESS?

Your One-Stop Solution for All Content Needs! Click here for more!
Categories: MySQL

SQl MATCH AGAINST find results with only more than 3 characters in the result

Share

In MySQL, while searching column using MATCH AGAINST keywords then the result matches all the row with search character more than 3.

If you see the system variable ft_min_word_len, which specifies the minimum length of words to be indexed by full-text searching, it defaults to 4, so 3-letter words won’t be found by full-text searching.

Run show variables like ‘ft_%’; to confirm that the word length matches what you set it to.

ft_min_word_len = 4  

You can change the effect by updating the ft_min_word_len variable in the my.cnf MySQL configuration file:

[mysqld]
ft_min_word_len = 3

Then you must restart the server and rebuild your FULLTEXT indexes.

For avoiding this issue, in this case, you can still use LIKE:

‘%$keyword%’ LIKE CONCAT(‘%’, Column, ‘%’)

Or regular expression:

‘%$keyword%’ REGEXP Column

Namaste UI

For any types of queries, you can contact us on info[at]namasteui.com.

Recent Posts

Xiaomi introduces the Redmi Note 11 series, which offers even more value for money

Xiaomi is one of the few companies that offer consumers devices that are packed with…

3 days ago

5 Reasons to use a professional mortgage broker

When you are looking to apply for a mortgage the one thing that most people…

3 days ago

5 grooming tips from recruiters what they want from candidates in an interview

Grooming for an interview is nothing like it is in the movies. Most people end…

3 days ago

4 Tips to hiring a finance broker

Finance brokers, also known as mortgage brokers, are very important professionals that are used during…

3 days ago

Common Household Plumbing Problems That Sydney Residents Endure

Despite being one of the most expensive real estate markets in the world, Australians still…

3 days ago

5 Stylish Interior Design Ideas for Small Bathrooms

When it comes to bathrooms, you have to do what you can with what you’ve…

3 days ago