MySQL full-text search does not work for some words such as "home"

I set a full text index for a small selection of entries across three fields (I tried a combination of three and also had the same result), and some words return the results in order, but some of them, such as 'home' and 'australia' are not do (interesting, "Australian" and "home").

Sounds like weird behavior. If I add "WITH QUERY EXPANSION", I get the results, but they are not the most relevant now.

Has anyone understood why this is? Otherwise, I will have to use LIKE queries, and I would prefer to enable relevance.

+5
source share
1 answer

This may be a few things:

  • MySQL has a list of default “stop words” that are not included in full-text search - http://dev.mysql.com/doc/refman/5.5/en/fulltext-stopwords.html . "home" and "australia" do not seem to be on this list, but the other words you are looking for may be affected by it.
  • Any word that appears in more than 50% of the lines or 3 letters or less in length in the database is also considered a stop word. A 50% thing is especially easy to catch if you just check a full text search on the table in just a few rows.

If you search Google for “mysql stop words”, you will find a lot more about this, as this is one of those things that many people catch.

+10

All Articles