1

I am trying to search my table for some mobile phones and am trying to get the results via Full-text search. My query is:

SELECT id,itemid,title,MATCH(title) AGAINST 
    ("SAMSUNG GALAXY S3" IN NATURAL LANGUAGE MODE) as score 
    FROM `deals`WHERE MATCH(title) AGAINST 
    ("SAMSUNG GALAXY S3" IN NATURAL LANGUAGE MODE) ORDER BY score desc;

The results i get are shown in the image below:

Search Result

What i expect is the second result to come up on top as it is the exact match, but it doesn't. Can somebody please correct me on what i might be doing wrong here.

Thanks.

Edit Results in boolean mode Results in boolean mode

2
  • What is the result IN BOOLEAN MODE ? Commented Jun 18, 2012 at 10:28
  • @bpgergo - here's the result - imgur.com/xhIbl. Commented Jun 18, 2012 at 10:33

1 Answer 1

1

I'm afraid "S3" is too short token to be considered to be a word by the full text search. See relevant section of the docs (the default minimum word length is 4 characters) http://dev.mysql.com/doc/refman//5.5/en/server-system-variables.html#sysvar_ft_min_word_len

EDIT you can verify this by searching for e.g.:

"SAMSUNG GALAXY S360"
Sign up to request clarification or add additional context in comments.

3 Comments

Yes, when i search for something like "Samsung Galaxy SIII", it works. Thanks a ton for helping me. Seems i need to find a way to address these kind of searches. Thanks a lot!
I think you can set 2 in ft_min_word_len, that should work for ""SAMSUNG GALAXY S3"
In that case i will have to rebuild the index, will check if this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.