ft_min_word_len set in local my.cnf?

前端 未结 2 452
失恋的感觉
失恋的感觉 2021-01-03 16:47

Is it possible to set ft_min_word_len for a certain user (such as by placing a my.cnf file in the user home dir with ft_min_word_len set)? The documentation says I need to r

相关标签:
2条回答
  • 2021-01-03 17:09

    No, it's not possible, because it changes how the fulltext indices are built. It takes effect at index generation, not (only) at query time.

    FYI: Not only do you have to restart the server, you have to rebuild all your fulltext indices after changing it.

    0 讨论(0)
  • 2021-01-03 17:14

    I'm working with this now, so to add as a reference for anyone looking at this...

    • You can use this query in a query browser or the MySQL prompt to show the state of ft_min_word_len: "SHOW VARIABLES LIKE 'ft_min_word_len';"
    • ft_min_word_len deafults to a value of '4' and is not by default listed in "my.cnf". To change it's default value, add: "ft_min_word_len = 3" to my.cnf under the [mysqld] section.
    • After changing the value of ft_min_word_len, the server must be restarted.
    • After changing the value of ft_min_word_len, any indexes you have must be rebuilt
    • A fast way to rebuild an index is to use this query: "REPAIR TABLE your_table_name QUICK;" Note: You're using the name of the table only, not the name of any indexes.
      If you have more than one index against the 'your_table_name' table, all of them will be re-built.
    0 讨论(0)
提交回复
热议问题