dt246813579
2014-01-20 06:53
浏览 53
已采纳

使用的表类型不支持FULLTEXT索引

I'm trying to do a fulltext search but it's not working in my web app. Here's an echo of the query and the error message:

SELECT name,id,city,state FROM campgrounds 
WHERE MATCH(name, city, state) AGAINST('camp' IN BOOLEAN MODE)

Invalid query: The used table type doesn't support FULLTEXT indexes

I have converted the table to MyISAM and then dropped the index and recreated it.

delimiter $$

CREATE TABLE `campgrounds` (
  `id` int(11) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `address` varchar(145) DEFAULT NULL,
  `city` varchar(145) NOT NULL,
  `state` varchar(5) NOT NULL,
  `zip` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `name` (`name`,`city`,`state`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8$$

If I copy the above query into MySQL Workbench and run it, it works.

图片转代码服务由CSDN问答提供 功能建议

我正在尝试进行全文搜索,但它无法在我的网络应用中运行。 这是查询和错误消息的回显:

  SELECT name,id,city,state FROM campgrounds 
WHERHER MATCH(name,city,state)AGAINST('camp' 在BOOLEAN模式中)
   
 
 

无效查询:使用的表类型不支持FULLTEXT索引

我已转换表 到MyISAM然后删除索引并重新创建它。

  delimiter $$ 
 
CREATE TABLE`campgrounds`(
`id`int(11)NOT NULL,\  n`name` varchar(255)DEFAULT NULL,
`address`varchar(145)DEFAULT NULL,
`city` varchar(145)NOT NULL,
`state`varchar(5)NOT NULL,
  zip` int(11)NOT NULL,
 PRIMARY KEY(`id`),
 FULLTEXT KEY`name`(`name`,`city`,`state`)
)ENGINE = MyISAM DEFAULT CHARSET = utf8 $  $ 
   
 
 

如果我将上述查询复制到MySQL Workbench并运行它,它就可以工作。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • douzhang7603 2014-01-20 16:38
    已采纳

    I'm a bonehead! MySQL workbench was attached to another server. I set it to my test server and the converted that table to MyISAM and all is good

    打赏 评论
  • dongmoxin7111 2014-01-20 07:04

    Clear the cache of your App (Memcache or query cache). Because if it works with mysqlworkbech then it should also work with web app.

    打赏 评论

相关推荐 更多相似问题