如何重置MYSQL中的停用词?
我想重置 mysql 中的停用词列表以进行全文搜索。 我已经在我的系统中安装了WAMP服务器,其中有phpmyadmin来访问mysql。 但我不知道如何重置 phpmyadmin 中的停用词。 谁能告诉我该怎么做。
我还 http://dev.mysql.com /doc/refman/5.1/en/server-system-variables.html#sysvar_ft_stopword_file 阅读此链接但不知道如何使用它???
I want to reset stop word list in mysql for FULLTEXT search. I have installed WAMP Server in my system which have phpmyadmin to access mysql. But I dont know how to reset stop word in phpmyadmin. Can anyone please tell me how to do that.
I also http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_ft_stopword_file read this link but don't know ho wto use this ???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我假设您正在使用 WampServer。
单击托盘图标,选择
MySQL
,然后单击my.ini
。 配置文件将在记事本中打开。 转到文件末尾并添加此行(在端口行之后):以禁用停用词。 如果您想使用自定义停用词文件,请将该行替换为:(
当然,设置停用词文件的路径)。
设置该行后,保存配置文件(文件 -> 保存)。 然后单击托盘图标,选择
MySQL
,然后选择服务
,然后单击重新启动服务
。要确保您的配置正确完成,请在浏览器中打开
phpMyAdmin
,单击顶部的Variables
选项卡,然后找到ft stopword file
并查看为其设置的值。I assume you're using WampServer.
Click the tray icon, select
MySQL
, then clickmy.ini
. The configuration file will open in notepad. Go to the end of the file and add this line (after the port line):to disable stop words. If you want to use custom stop-word file, replace that line with:
(set the path of the stopword file, of course).
After setting that line, save the configuration file (File -> Save). Then click the tray icon, select
MySQL
, thenService
, then clickRestart Service
.To Ensure that your configuration is done correctly, open
phpMyAdmin
in the browser, click on theVariables
tab at the top, then findft stopword file
and see the values that is set to it.我遇到了同样的问题,我不认为你必须重新编译任何东西,我读到你可以使用 mysql 控制台 SET ft_stopword_file='path/to/stopword_file.txt',这不需要重新启动你的服务器。 但我认为它不会持续到下次重新启动,所以我想我会尝试配置文件,看看它是否有效
I have got the same problem, I don't think you have to recompile anything, I've read that you can use the mysql console SET ft_stopword_file='path/to/stopword_file.txt', that should not require restarting your server. but I don;t think it will last till the next restart, so I guess I'll try the config file, and see if it works
MySQL 附带的停用词列表(至少对于 MyISAM)可以在 MySQL 的源代码
myisam/ft_static.c
中找到。另请注意,这些只是“英语”停用词。 据推测,其他语言的停用词在其他地方定义...
您可以使用注释中指出的 ft_stopword_file 指令覆盖或禁用默认停用词列表。 此处有完整文档。
The list of stopwords that MySQL ships with (at least for MyISAM) can be found in MySQL's source, in
myisam/ft_static.c
.Note also that these are only the 'English' stopwords. Presumably, stopwords for other languages are defined elsewhere...
You can override or disable the default stopword list using the
ft_stopword_file
directive as pointed out in the comments. Full documentation here.我遇到了同样的问题。
停用词文件必须包含在 my.ini 文件的 [mysqld] 部分下。
[mysqld]
ft_stopword_file = 'D:/stop.txt' 然后
修复表 tablename 对我有用。
i wass having same problem.
stopwords file must be included under [mysqld] section in my.ini file.
[mysqld]
ft_stopword_file = 'D:/stop.txt' then
repair table tablename worked for me.
您可以在此处找到要使用的停用词列表: https: //dev.mysql.com/doc/refman/5.6/en/fulltext-stopwords.html。 我将此列表保存到一个文件中,并从 MySQL 配置文件中引用它(例如 ft_stopword_file='path/to/stopword_file.txt')。
我从停用词列表中删除了“it”和“us”,因为它们在我的问题域中意味着“信息技术”和“美国”。
不幸的是,每次更改停用词列表时,您都必须重新启动 MYSQL 并重建全文索引。
You can find a list of stop words to use here: https://dev.mysql.com/doc/refman/5.6/en/fulltext-stopwords.html. I saved this list to a file and referenced it from the MySQL config file (e.g.
ft_stopword_file='path/to/stopword_file.txt'
).I removed "it" and "us" from the stopword list because they mean "Information Technology" and "United States" in my problem domain.
Unfortunately, every time you change the stopword list you have to restart MYSQL and rebuild the full-text index's.