FULLTEXT搜索有什么问题? [英] What's the problem with FULLTEXT search?

查看:68
本文介绍了FULLTEXT搜索有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在MySQL中创建了一个包含FULLTEXT索引并在该表中插入记录的表。当我进行FULLTEXT搜索时,结果将是:空集(0.00秒)

有什么问题?



代码:

Hello,
I created a table in MySQL which contains a FULLTEXT index and inserted a record into that table. When I do a FULLTEXT search, the result would be: "Empty set (0.00 sec)".
What's the problem?

The codes:

CREATE TABLE t1(
name NVARCHAR(25),
family NVARCHAR(25),
FULLTEXT(name, family)) ENGINE MyISAM;

INSERT INTO t1(name, family) VALUES('saleh', 'negahdari');

SELECT * FROM t1 WHERE
MATCH(name, family) AGAINST('saleh');

推荐答案

问题是你只在测试表中插入了一行。

如果你< a href =http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html> RTFM [ ^ ]您会注意到FULLTEXT索引使用自然语言搜索作为默认搜索模式和单词50%或更多行中存在的行被认为是常见的并且不匹配。
A problem is that you have inserted only one row to the test table.
If you RTFM[^] you'll notice that FULLTEXT indexes use natural language search as default search mode and that words that are present in 50% or more of the rows are considered common and do not match.


这篇关于FULLTEXT搜索有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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