MySql Fulltext Search not correct with short words

前端 未结 2 1577
轮回少年
轮回少年 2021-01-26 01:51

After many tries and many searches i came to the following query:

SELECT id,
       title,
       description,
       MATCH(title,description,tags) AGAINST (\'$s         


        
2条回答
  •  情书的邮戳
    2021-01-26 02:12

    MySQL has two important parameters for full text search, stop words and minimum word length. The first is the minimum word size (documented here):

    • Innodb: innodb_ft_min_token_size (default 3)
    • MyIsam: ft_min_word_len (default 4)

    Words shorter than the minimum are not indexed, so you cannot search on them. Remember to rebuild the index after changing the parameter. Conveniently (hah!) they have different default values.

    In addition, there are stop word lists to remove common stop words. Whether or not this is an issue depends on what words you are searching for. You can customize the stop words.

提交回复
热议问题