user3243925
user3243925

Reputation: 271

match against not making sense

This is my filter text:

Oliver used book

If I search for 'Oliver' it works, if I search for 'book' it works but if I search for 'used' it does not work.

Heater white fan HEOP1322

Heater -> works : white -> works : fan -> does not work : HEOP -> does not work : HEOP1322 -> works.

My query is like this:

SELECT * FROM table WHERE MATCH(filter) AGAINST ('fan' IN BOOLEAN MODE)
SELECT * FROM table WHERE MATCH(filter) AGAINST ('HEOP' IN BOOLEAN MODE)
SELECT * FROM table WHERE MATCH(filter) AGAINST ('used' IN BOOLEAN MODE)

Why d'hell does the word used not work and the word book works? They have the same length.

I also tried this suggestions Mysql search for string and number using MATCH() AGAINST() without success.

Edit: Solved, follow this instructions. XAMPP MySQL - Setting ft_min_word_len

Upvotes: 0

Views: 72

Answers (1)

deceze
deceze

Reputation: 522636

"used" is one of the default MySQL full text stopwords: https://dev.mysql.com/doc/refman/5.1/en/fulltext-stopwords.html. Stopwords are words which are ignored because they are too frequent in the (English) language and would not positively contribute to the result of a full text search. If you're only querying for single words, a LIKE %..% query may be more suited than a full-blown full text search.

Upvotes: 1

Related Questions