MySQL:全文搜索出了点问题-未返回任何结果 [英] MySQL: Something wrong with Fulltext search - Returning NO results

查看:65
本文介绍了MySQL:全文搜索出了点问题-未返回任何结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张桌子places(name vachar(50), address text, description text) engine = MYISAM和几条记录.

I have a table places(name vachar(50), address text, description text) engine = MYISAM and few records.

我一直尝试在此处 !,然后搜索全文问题",但我不清楚全文搜索.

I have been trying to do some example in here!, and searching for the 'full-text problem' but i have not clear about fulltext search.

首先,我通过以下方式添加全文索引:

First, i add a fulltext index by:

ALTER TABLE places ADD FULLTEXT(name, address, description);

并尝试使用mySQL:

and try mySQL:

SELECT * FROM places WHERE MATCH(name,address,description) AGAINST('my search key');

我尝试了一些内容很多领域的我的搜索关键字",但在某些情况下我遇到了:

i have try some 'my search key' that content is in many field, but there are some case i got:

  • 现在选择了行.

  • now row selected .

如果我尝试使用add option "IN BOOLEAN MODE" in AGAINST(),则得分为= 1时获得的结果,对我进行排序时毫无意义.

if i trying add option "IN BOOLEAN MODE" in AGAINST(), result obtained with score =1 , its is meaningless when i sort it .

仅在搜索关键字"字段(名称)中包含内容时显示结果.

it just show the result when the "search key" has content in field (name).

我尝试了很多方法,但是我不记得所有情况了,

i tried a lot way but i don't remember all cases,

任何答案都可以帮助您!

Any answer could help!

提前谢谢!

推荐答案

确保您的关键字不是禁用或修改停用词列表,则需要访问权限以设置系统变量并重新启动服务器.

Ensure that your key word is not a stop word. To disable or modify the stop word list, you'll need access to set system variables and restart the server.

还要确保您的关键字符合最小的全文单词长度.默认的最小长度是4.

Also, ensure that your key word meets the minimum full text word length. The default minimum length is 4.

最后,确保单词出现在少于50%的记录中.当单词出现在记录的50%或更多时,MySQL不会返回结果.

Finally, ensure that the word appears in less than 50% of the records. MySQL won't return results where the word appears in 50% or more of the records.

这篇关于MySQL:全文搜索出了点问题-未返回任何结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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