mysqlmatch-against

MySQL MATCH AGAINST not giving result


I have made a MySQL statement with a MATCH AGAINST. I'm not used to use this function, but it looks really easy.

But when I use this query:

SELECT productnaam, 
       productomschrijving, 
       MATCH (productnaam, productomschrijving) AGAINST('Kop van Jut'), 
       MATCH (productnaam, productomschrijving) AGAINST('Springkussen')
FROM product
WHERE product.productid in (508, 578)

I get these output: enter image description here

I really don't understand why I don't get a value greater than zero for 'Kop van Jut'. I've also tried to use double quotes, a plus sign and so on. Nothing works.

Can somebody tell me what I do wrong?


Solution

  • The reason 'Kop van Jut' returns a 0 result is that the words in your search string are too short. For MyISAM tables, the minimum word length that is considered in a full-text search is 4 characters. From the manual:

    • Some words are ignored in full-text searches:

      Any word that is too short is ignored. The default minimum length of words that are found by full-text searches is three characters for InnoDB search indexes, or four characters for MyISAM.

    If you can set system variables, you can adjust the value of ft_min_word_len down to 3 to make your match work on that particular search string.