Updated on 2024-04-11 GMT+08:00

Does MySQL 8.0 Support Full-Text Search?

Yes. MySQL 8.0 supports full-text search. The keyword is FULLTEXT. Run the following SQL statements to perform a test.

  • Creating a table
CREATE TABLE ARTICLE (
id int unsigned NOT NULL AUTO_INCREMENT, 
title varchar(200) DEFAULT NULL, 
Content text,
PRIMARY KEY (id), 
FULLTEXT KEY title (title,content),
FULLTEXT KEY fulltext_article (title,content)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  • Creating an index
    ALTER TABLE ARTICLE ADD FULLTEXT INDEX fulltext_article (title,content);
  • Querying an index
    SHOW INDEX FROM ARTICLE;