云数据库 RDS-RDS for MySQL 8.0是否支持全文检索

时间:2024-08-14 10:01:55

RDS for MySQL 8.0是否支持全文检索

MySQL 8.0版本支持全文检索,关键字为FULLTEXT。可执行如下SQL语句测试。

  • 创建表
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;
  • 创建索引
    ALTER TABLE ARTICLE ADD FULLTEXT INDEX fulltext_article (title,content);
  • 查看索引
    SHOW INDEX FROM ARTICLE;
support.huaweicloud.com/rds_faq/rds_faq_1001.html