码迷,mamicode.com
首页 > 其他好文 > 详细

29_全文索引与停止词

时间:2015-05-20 18:40:30      阅读:87      评论:0      收藏:0      [点我收藏+]

标签:following   database   标点符号   against   primary   


关于全文索引的用法

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");



29_全文索引与停止词

标签:following   database   标点符号   against   primary   

原文地址:http://1154179272.blog.51cto.com/10217799/1653270

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!