关于全文索引的用法
macth (全文索引名) against ("要查找的单词");
关于全文索引的停止词
全文索引不针对非常频繁的词做索引,
如this,you,my等
全文索引:在mysql的默认情况下,对于中文意义不大
因为英文有空格,标点符号来拆成单词,进而对单词进行索引,
而对于中文,没有空格来隔开单词,mysql无法识别每个中文词。
create table artical(
id int primary key auto_increment,
title varchar(200),
body text,
fulltext (title,body)
)engine=myisam charset utf8;
insert into artical
(title,body)
values
("how to use ","this is a table of healthy"),
("MySQL vs. YourSQL ","In the following database ");
select id,match(title,body) against("database") from artical;
select * from artical where match (title,body) against ("database");
时间: 2024-10-29 19:08:25