我正在尝试使用mysql 5.6上的innodb进行全文搜索,并在FULLTEXT KEY
上添加了submissions.title, submissions.description
。以下是show create table
的{{1}}:
submissions
当我运行以下查询时:
Create Table: CREATE TABLE `submissions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`slug` varchar(255) NOT NULL,
`description` mediumtext NOT NULL,
`user_id` int(11) NOT NULL,
`created` datetime NOT NULL,
`type` enum('tip','request') NOT NULL,
`thumbnail` varchar(64) CHARACTER SET latin1 DEFAULT NULL,
`removed` tinyint(1) unsigned NOT NULL DEFAULT '0',
`keywords` varchar(255) NOT NULL,
`ip` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
FULLTEXT KEY `title` (`title`,`description`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8
我将SELECT s.*, MATCH (s.title, s.description) AGAINST ('whatever'), u.username, SUM( sv.up ) helpfulVotes
FROM submissions s
INNER JOIN users u ON s.user_id = u.id
LEFT JOIN submissions_votes sv ON s.id = sv.submission_id
GROUP BY s.id
ORDER BY s.created DESC
LIMIT 0 , 30
视为错误。
这是否意味着我需要在我加入的其他字段中添加全文?因为我没有搜索任何这些领域,所以没有意义......
编辑:我的prod机器上有一个更老的mysql版本的查询,加上我的查询错误。正确查询:
#1214 - The used table type doesn't support FULLTEXT indexes
答案 0 :(得分:0)
我认为全文搜索仅限ISAM。