views:

167

answers:

2

I am trying to perform a search for users based on a full-text search.

SELECT * FROM users WHERE MATCH ( name ) AGAINST ( 'FDR' IN BOOLEAN MODE );

However the query yields no results. I can replace the search value with other strings and yield results.

I have even tried using a null stop word list with no success. The problem seems to with this particular string.

+4  A: 

If this article is still valid, then it's because MySQL fulltext indexing doesn't index words <= 3 characters long.

notnot
+6  A: 

From dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html

The default minimum value is four characters; the default maximum is version dependent. If you change either value, you must rebuild your FULLTEXT indexes.

The minimum and maximum lengths of words to be indexed are defined by the ft_min_word_len and ft_max_word_len system variables.

Also see Server System Variables

Michael Glenn
I had built my index with the ft_min_word_len = 4 and subsequently lowered it to 3. However, I did realize that FULLTEXT indexes needed to be rebuilt. Is there way to rebuild them without dropping and rebuilding them?
mike_wags
"To rebuild the indexes in this case, it is sufficient to do a QUICK repair operation:"mysql> REPAIR TABLE tbl_name QUICK;" - http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html
Michael Glenn