如何编写不考虑任何停用词的完整搜索索引查询? [英] How can I write full search index query which will not consider any stopwords?

查看:46
本文介绍了如何编写不考虑任何停用词的完整搜索索引查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个查询,它将使用 mysql 表中的完整搜索索引执行全文搜索.

I have written a query which will perform Full Text search using full search Index in mysql Table.

但我的问题是,当用户使用to go"进行搜索时,由于 mysql 中的停用词,它不会搜索任何内容.

But my problem is that when user searches with "to go" then it will not search anything because of stopwords in mysql.

所以我的问题是,我怎样才能编写一个忽略停用词的完整搜索查询?

So my question is, how can I write a Full Search query which will ignore the stopwords?

推荐答案

要覆盖默认停用词列表,请设置 ft_stopword_file 系统变量.(参见第 5.1.4 节,服务器系统变量".) 变量值应该是包含停用词列表的文件的路径名,或禁用停用词过滤的空字符串.服务器在数据目录中查找文件,除非给出了绝对路径名来指定不同的目录.更改此变量的值或停用词文件的内容后,重新启动服务器并重建 FULLTEXT 索引.

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.

http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html

这篇关于如何编写不考虑任何停用词的完整搜索索引查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆