码迷,mamicode.com
首页 > 数据库 > 详细

【mysql】全文索引match多列报错

时间:2016-04-22 16:12:34      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:

表结构如下:

 CREATE TABLE `T` (
  ....
  FULLTEXT KEY `title_fc` (`titleindex`),
  FULLTEXT KEY `shortname_fc` (`shortnameindex`)
) ENGINE=InnoDB AUTO_INCREMENT=50962041 DEFAULT CHARSET=utf8 

创建了两个全文索引,但是在查找的时候,却出现如下这样的错误。

mysql> SELECT count(1) as count FROM T a WHERE 1 = 1  AND MATCH (a.titleindex) AGAINST ("5YeM 5Yqo" IN BOOLEAN MODE );
+-------+
| count |
+-------+
|    70 |
+-------+
1 row in set (0.01 sec)

mysql> SELECT count(1) as count FROM T a WHERE 1 = 1  AND MATCH (a.shortnameindex) AGAINST ("5YeM 5Yqo" IN BOOLEAN MODE ) ;
+-------+
| count |
+-------+
|     6 |
+-------+
1 row in set (0.00 sec)

mysql> SELECT count(1) as count FROM T a WHERE 1 = 1  AND MATCH (a.shortnameindex ,a.titleindex) AGAINST ("5YeM 5Yqo" IN BOOLEAN MODE ) ;
ERROR 1191 (HY000): Cant find FULLTEXT index matching the column list

单独match某一列可以正常查询,但是match多列就报错。

后来从MySQL的文档上面找到:The MATCH() column list must match exactly the column list in some FULLTEXT index definition for the table, unless this MATCH() is IN BOOLEAN MODE on a MyISAM table.

【mysql】全文索引match多列报错

标签:

原文地址:http://www.cnblogs.com/seyjs/p/5421421.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!