0

I have a strange problem - I use MySQL 5.1 and a table with Fulltable-Index. In the mysql config, ft_min_word_len is set to 2 (so words with a length of at least two characters are indexed).

The queries below are simplified, but have the same effect as the original one.

When I search for:

SELECT company FROM my_table WHERE MATCH (company) AGAINST ('intern*' IN BOOLEAN MODE)

I get companies with "internat" in it's name - like "International Inc.", "Internship.org".

However when I search for:

SELECT company FROM my_table WHERE MATCH (company) AGAINST ('just*' IN BOOLEAN MODE)

I don't get any result, although there is an entry in the table "Justice & Travelling".

But when I search for:

 SELECT company FROM my_table WHERE MATCH (company) AGAINST ('travelling*' IN BOOLEAN MODE)

I get the "Justice & Travelling"-Entry / correct result.

And if I search with LIKE %just% instead of MATCH-AGAINST, I also get the correct results.

Does anybody have an idea, why I don't get the correct result in the second mentioned query?

knittl
  • 246,190
  • 53
  • 318
  • 364
Stefan
  • 337
  • 6
  • 20

1 Answers1

1

Found the troublemaker:
It was because of the stop-words list. Disabling the list by adding the following line to my.cnf solved the problem:
ft_stopword_file = ''

Further Details you can find at the links below:
MySQL: 11.9.6. Fine-Tuning MySQL Full-Text Search
MySQL: 11.9.4. Full-Text Stopwords

Stefan
  • 337
  • 6
  • 20