gpt4 book ai didi

mysql - 如何在 LAMP 上的 MySQL 中用用户定义的列表覆盖 "Full-Text Stopwords"的内置停用词列表?

转载 作者:行者123 更新时间:2023-11-30 23:09:17 25 4
gpt4 key购买 nike

我在我的机器上使用 LAMP,我在我的网站上使用全文搜索功能。我不想在全文搜索期间考虑默认的“全文停用词”列表。但我想手动提供一些停用词,在全文搜索期间不得考虑这些停用词。谁能告诉我应该如何实现这一目标?如果您需要有关该问题的任何进一步信息,我可以为您提供相同的信息。感谢您理解我的问题。

最佳答案

根据 Fine-Tuning MySQL Full-Text Search 记录:

  • To override the default stopword list, set the ft_stopword_file system variable. (See Section 5.1.4, “Server System Variables”.) The variable value should be the path name of the file containing the stopword list, or the empty string to disable stopword filtering. The server looks for the file in the data directory unless an absolute path name is given to specify a different directory. After changing the value of this variable or the contents of the stopword file, restart the server and rebuild your FULLTEXT indexes.

    The stopword list is free-form, separating stopwords with any nonalphanumeric character such as newline, space, or comma. Exceptions are the underscore character (“_”) and a single apostrophe (“'”) which are treated as part of a word. The character set of the stopword list is the server's default character set; see Section 10.1.3.1, “Server Character Set and Collation”.

请注意,如该页其他地方所述,您必须在 MySQL 启动时设置此变量(例如,作为命令行选项,或在相关选项文件的 [mysqld] 部分)和必须在更改后重建全文索引。

关于mysql - 如何在 LAMP 上的 MySQL 中用用户定义的列表覆盖 "Full-Text Stopwords"的内置停用词列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20561425/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com