MySQL FULLTEXT indexes issue

跟風遠走 提交于 2019-11-27 12:03:16

问题


I’m trying to create a FULLTEXT index on an attribute of a table. Mysql returns

ERROR 1214: The used table type doesn’t support FULLTEXT indexes.

Any idea what I’m doing wrong?


回答1:


You’re using the wrong type of table. Mysql supports a few different types of tables, but the most commonly used are MyISAM and InnoDB. MyISAM (in MySQL 5.6+also InnoDB tables) are the types of tables that Mysql supports for Full-text indexes.

To check your table’s type issue the following sql query:

SHOW TABLE STATUS

Looking at the result returned by the query, find your table and corresponding value in the Engine column. If this value is anything except MyISAM or InnoDB then Mysql will throw an error if your trying to add FULLTEXT indexes.

To correct this, you can use the sql query below to change the engine type:

ALTER TABLE <table name> ENGINE = [MYISAM | INNODB]

Additional information (thought it might be useful): Mysql using different engine storage types to optimize for the needed functionality of specific tables. Example MyISAM is the default type for operating systems (besides windows), preforms SELECTs and INSERTs quickly; but does not handle transactions. InnoDB is the default for windows, can be used for transactions. But InnoDB does require more disk space on the server.




回答2:


Up until MySQL 5.6, MyISAM was the only storage engine with support for full-text search (FTS) but it is true that InnoDB FTS in MySQL 5.6 is syntactically identical to MyISAM FTS. Please read below for more details.

InnoDB Full-text Search in MySQL 5.6




回答3:


The mysql manual says that FULLTEXT indexes can only be created on tables with the mylsam engine.




回答4:


Are you using InnoDB? The only table type that supports FULLTEXT is MyISAM.




回答5:


apart from MyISAM table PARTITIONING also not support full-text index.



来源:https://stackoverflow.com/questions/963534/mysql-fulltext-indexes-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!