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

Recent Posts

Fractional CTO Services: Catalyzing Growth in the Logistics Sector

In today's fast-paced digital world, the logistics and supply chain sector is encountering unprecedented challenges…

6 hours ago

How to Increase E-commerce Site Speed for Fast Conversions?

Website navigation and speed play a significant role in the success of online business. Attractive…

21 hours ago

Jackpotjoy: The UK Beloved Online Casino

Welcome to your ultimate guide to Jackpot joy, the crown jewel of UK online casinos!…

3 days ago

Comparative Analysis of Hybrid Mobile App Development Frameworks

The demand for mobile apps has risen rapidly. The reason? The modern customers proactively rely…

3 days ago

The Rise of Electric Cars in Modern Mobility

In recent years, a significant shift has occurred in the automotive industry as electric vehicles…

4 days ago

Top 3 South Goa beaches worth visiting in summers

Goa is a tiny emerald state of India which is quite famous for attracting tourists…

4 days ago