<p>The error appears when a FULLTEXT index uses a non-BTREE index on the internal DOC_ID column, preventing InnoDB from building the FULLTEXT index.</p>
<p>MySQL Error 1798 ER_INNODB_FT_WRONG_DOCID_INDEX happens when the DOC_ID column of an InnoDB FULLTEXT index is not backed by a BTREE primary or unique index. Convert the DOC_ID index to BTREE or recreate the FULLTEXT index to resolve the problem.</p>
Index '%s' is of wrong type for an InnoDB FULLTEXT index
The error message Index '%s' is of wrong type for an InnoDB FULLTEXT index signals that InnoDB could not create or use a FULLTEXT index because its hidden DOC_ID column is indexed with the wrong index type.
InnoDB expects the DOC_ID column of every FULLTEXT index to be covered by a BTREE primary or unique index. When this requirement is violated, MySQL raises error 1798 during CREATE INDEX, ALTER TABLE, or OPTIMIZE TABLE operations.
During FULLTEXT searches InnoDB maps matching words to internal document identifiers. Efficient lookups require BTREE ordering of those identifiers; other index types such as FULLTEXT or HASH cannot satisfy this lookup pattern.
Because the engine relies on this structure, any conflicting index definition blocks the operation until the mismatch is fixed.
The error commonly arises when a developer manually drops the primary key, switches the storage engine, or adds a secondary FULLTEXT index that conflicts with an earlier definition. It can also show up during dump-and-restore workflows on older table backups.
No data is lost, but search queries on the affected table will either fail or omit new rows until the FULLTEXT index is rebuilt correctly. Fixing the index is therefore critical for accurate text search results.
Removing the table's primary key leaves the DOC_ID column without the required BTREE index.
Converting a MyISAM table with FULLTEXT indexes to InnoDB without recreating indexes triggers the type mismatch.
Creating another FULLTEXT index on the same DOC_ID column overwrites the needed BTREE index.
Raised when attempting to add a FULLTEXT index to a table without an AUTO_INCREMENT primary key.
Generic failure to create a FULLTEXT index due to size limits or unsupported column types.
Occurs when the hidden DOC_ID column required for FULLTEXT search is missing.
No. Your FULLTEXT index is unusable until you resolve the mismatch, so search results will be incomplete.
Yes, but it sacrifices InnoDB benefits. A better solution is to recreate the correct BTREE index in InnoDB.
Galaxy's editor highlights engine-specific index requirements and flags conflicting index definitions before execution.
ALTER TABLE operations are online in MySQL 8.0 for InnoDB FULLTEXT indexes on most platforms, minimizing downtime.