mysqlsortingmatchagainst

MATCH AGAINST in MySQL don't work


I have a problem with FULLTEXT search in MySql. I create query:

SELECT searchTag, MATCH (searchTag) AGAINST ('after party') as score FROM post WHERE MATCH (searchTag) AGAINST ('after party') ORDER BY score DESC

Its result:

 1. we,like,to,party 3.6987853050231934 
 2. f,w,g,party 3.6987853050231934
 3. after,party,tooka 3.657205581665039

Why number 3 have lower score if it have two words searching?


Solution

  • after is a stop word. It is ignored by a FULLTEXT MATCH query.

    Basically, the word "after" is so common in the English language that including it in a query is semantically meaningless.

    Think of it this way: imagine a query against the word "a". There are so many sentences which use the word "a", that a match against them really won't provide you with anything useful.

    In this post, all of the sentences reference the word "a".