1
SELECT * 
FROM t_book AS book
WHERE MATCH (
b_title, author
)
AGAINST (
'med')

After run above sql command its showing empty result, but after run below sql code. it showing all results. * It showing result when keyword length is greater than 3 characters ex: 'medi' is showing results

SELECT * 
FROM t_book AS book
WHERE MATCH (
b_title, author
)
AGAINST (
'medical')

Could you please explain this. Thanks.

iswan
  • 92
  • 1
  • 3
  • 14
  • 2
    Typing that title into Google brought me this: http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html – deceze Jun 20 '13 at 07:03

1 Answers1

2

There is often a minimum word length for searches. The default for MySQL is a keyword length of 3. Perhaps your MySQL admin has specified a bigger minimum word length? If so, a 3-word character would not be used in a match query.

You can find the setting in the following section in the MySQL configuration file:

[mysqld]
ft_min_word_len=3

You can read more about it here: http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.html

Erik Schierboom
  • 16,301
  • 10
  • 64
  • 81