create table test(
id int auto_increment primary key,
title VARCHAR(200),
body TEXT,
FULLTEXT (title,body)
);insert into test values(56, 'the line', '爱我');
insert into test values(57, 'the line', '爱我别走');
insert into test values(33, 'the line', '中国');
insert into test values(58, 'the line', '美国');select id, title, body from test where match(title, body) against('爱我');
select id, title, body from test where match(title, body) against('爱我别走');
select id, title, body from test where match(title, body) against('中国');
select id, title, body from test where match(title, body) against('美国');如果说按照上边的查询语句去查找这些中文,'爱我','爱我别走'这类词没有找到的话,我觉得很正常,因为mysql数据库里没装什么中文分词插件,
可是没想到'中国','美国'这些词却能够检索到,难道mysql内有一个中文分词的词库?如果有的话,在什么地方?我该如何使用?我的数据库版本是5.1.35-community
但这个是肯定检索不到的:insert into test values(88, 'the line', '爱我 别走');
mysql> select id, title, body from test where match(title, body) against('中国');
+----+----------+-----------+
| id | title | body |
+----+----------+-----------+
| 32 | | 中国 |
| 77 | the line | 中国 美国 |
+----+----------+-----------+