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

How to tell whether high-level glass is toughened or laminated

Glass at height is easy to overlook, in both senses. It is out of reach,…

6 days ago

Signs Your Rental Business Has Outgrown Spreadsheets (and What to Do Next)

Almost every rental business starts the same way. A handful of items, a notebook or…

6 days ago

Why You Should Demand a Team Of Office Interior Design

When it comes to designing the office interior you need a highly professional designer. Your…

7 days ago

Understanding the Basics of First Aid and Emergency Response in Canberra

Emergencies can happen anywhere, whether at home, in the workplace, at school, or during outdoor…

2 weeks ago

How Guest Posts for Dental Practices Build Trust and Digital Reach

A dental practice’s website is essential, but it is only one place where prospective patients…

3 weeks ago

Small Personal Touches That Make a Golf Day More Enjoyable

Golf is often described as a game of patience, practice, and precision. That is true,…

3 weeks ago