MySQL full text search for words with three or less letters

后端 未结 1 1963
情话喂你
情话喂你 2020-11-30 09:08

I\'m trying to get my full text search (in boolean mode) to retrieve words with three letters or less.

Currently, if I search for something like \"NBA\", I don\'t ge

相关标签:
1条回答
  • 2020-11-30 09:54

    This section of the manual might interest you : 11.8.6. Fine-Tuning MySQL Full-Text Search (quoting a portion of it) :

    The minimum and maximum lengths of words to be indexed are defined by the ft_min_word_len and ft_max_word_len system variables. The default minimum value is four characters; the default maximum is version dependent. If you change either value, you must rebuild your FULLTEXT indexes.
    For example, if you want three-character words to be searchable, you can set the ft_min_word_len variable by putting the following lines in an option file:

    [mysqld]
    ft_min_word_len=3
    

    Then you must restart the server and rebuild your FULLTEXT indexes.

    (You should read that page, for more informations I didn't copy-paste ;-) )

    0 讨论(0)
提交回复
热议问题