mysql全文索引之停止词(stopword)

MySQL全文索引中,停止词会被忽略。InnoDB和MyISAM有不同的默认停止词列表,可以查询INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD获取InnoDB的默认停止词。MyISAM的停止词在源码中预设,可通过ft_stopword_file覆盖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本文IT技术学习网将给大家讲述什么是mysql全文索引中的停止词(stopword也有的翻译做停止字)。

stopword

在全文索引中,如果一个词被认为是太普通或者太没价值,那么它将会被搜索索引和搜索查询忽略。innodb和myisam分别有两组不同的设置,控制着对应的stopword。

全文检索时,停止词列表将会被读取和检索,在不同的字符集和排序方式下(character_set_server and collation_server 系统变量),可能会导致在搜索时的停止词的不匹配。

停止词是否大小写敏感,取决于不同的排序方式,比如:latin1_swedish_ci下停止词是大小写敏感的,latin1_general_cs 或 latin1_bin下停止词是大小写不敏感的。

innodb的索引停止词

innodb的默认停止词列表很短。查询INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD表来查看默认的innodb停止词表。

    1. mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD;

 

    1. +-------+

 

    1. | value |

 

    1. +-------+

 

    1. | a     |

 

    1. | about |

 

    1. | an    |

 

    1. | are   |

 

    1. | as    |

 

    1. | at    |

 

    1. | be    |

 

    1. | by    |

 

    1. | com   |

 

    1. | de    |

 

    1. | en    |

 

    1. | for   |

 

    1. | from  |

 

    1. | how   |

 

    1. | i     |

 

    1. | in    |

 

    1. | is    |

 

    1. | it    |

 

    1. | la    |

 

    1. | of    |

 

    1. | on    |

 

    1. | or    |

 

    1. | that  |

 

    1. | the   |

 

    1. | this  |

 

    1. | to    |

 

    1. | was   |

 

    1. | what  |

 

    1. | when  |

 

    1. | where |

 

    1. | who   |

 

    1. | will  |

 

    1. | with  |

 

    1. | und   |

 

    1. | the   |

 

    1. | www   |

 

    1. +-------+

 

  1. 36 rows in set (0.00 sec)

myisam索引的停止词

myisam索引的停止词列表与innodb不同,默认的myisam停止词列表是直接在mysql程序源码中已写入。设置ft_stopword_file系统变量来指定停止词文件,从而覆盖默认设置。

在mysql源程序的 storage/myisam/ft_static.c file文件中,你可以找到默认的myisam停止词列表:

    1. a's able about above according

 

    1. accordingly across actually after afterwards

 

    1. again against ain't all allow

 

    1. allows almost alone along already

 

    1. also although always am among

 

    1. amongst an and another any

 

    1. anybody anyhow anyone anything anyway

 

    1. anyways anywhere apart appear appreciate

 

    1. appropriate are aren't around as

 

    1. aside ask asking associated at

 

    1. available away awfully be became

 

    1. because become becomes becoming been

 

    1. before beforehand behind being believe

 

    1. below beside besides best better

 

    1. between beyond both brief but

 

    1. by c'mon c's came can

 

    1. can't cannot cant cause causes

 

    1. certain certainly changes clearly co

 

    1. com come comes concerning consequently

 

    1. consider considering contain containing contains

 

    1. corresponding could couldn't course currently

 

    1. definitely described despite did didn't

 

    1. different do does doesn't doing

 

    1. don't done down downwards during

 

    1. each edu eg eight either

 

    1. else elsewhere enough entirely especially

 

    1. et etc even ever every

 

    1. everybody everyone everything everywhere ex

 

    1. exactly example except far few

 

    1. fifth first five followed following

 

    1. follows for former formerly forth

 

    1. four from further furthermore get

 

    1. gets getting given gives go

 

    1. goes going gone got gotten

 

    1. greetings had hadn't happens hardly

 

    1. has hasn't have haven't having

 

    1. he he's hello help hence

 

    1. her here here's hereafter hereby

 

    1. herein hereupon hers herself hi

 

    1. him himself his hither hopefully

 

    1. how howbeit however i'd i'll

 

    1. i'm i've ie if ignored

 

    1. immediate in inasmuch inc indeed

 

    1. indicate indicated indicates inner insofar

 

    1. instead into inward is isn't

 

    1. it it'd it'll it's its

 

    1. itself just keep keeps kept

 

    1. know known knows last lately

 

    1. later latter latterly least less

 

    1. lest let let's like liked

 

    1. likely little look looking looks

 

    1. ltd mainly many may maybe

 

    1. me mean meanwhile merely might

 

    1. more moreover most mostly much

 

    1. must my myself name namely

 

    1. nd near nearly necessary need

 

    1. needs neither never nevertheless new

 

    1. next nine no nobody non

 

    1. none noone nor normally not

 

    1. nothing novel now nowhere obviously

 

    1. of off often oh ok

 

    1. okay old on once one

 

    1. ones only onto or other

 

    1. others otherwise ought our ours

 

    1. ourselves out outside over overall

 

    1. own particular particularly per perhaps

 

    1. placed please plus possible presumably

 

    1. probably provides que quite qv

 

    1. rather rd re really reasonably

 

    1. regarding regardless regards relatively respectively

 

    1. right said same saw say

 

    1. saying says second secondly see

 

    1. seeing seem seemed seeming seems

 

    1. seen self selves sensible sent

 

    1. serious seriously seven several shall

 

    1. she should shouldn't since six

 

    1. so some somebody somehow someone

 

    1. something sometime sometimes somewhat somewhere

 

    1. soon sorry specified specify specifying

 

    1. still sub such sup sure

 

    1. t's take taken tell tends

 

    1. th than thank thanks thanx

 

    1. that that's thats the their

 

    1. theirs them themselves then thence

 

    1. there there's thereafter thereby therefore

 

    1. therein theres thereupon these they

 

    1. they'd they'll they're they've think

 

    1. third this thorough thoroughly those

 

    1. though three through throughout thru

 

    1. thus to together too took

 

    1. toward towards tried tries truly

 

    1. try trying twice two un

 

    1. under unfortunately unless unlikely until

 

    1. unto up upon us use

 

    1. used useful uses using usually

 

    1. value various very via viz

 

    1. vs want wants was wasn't

 

    1. way we we'd we'll we're

 

    1. we've welcome well went were

 

    1. weren't what what's whatever when

 

    1. whence whenever where where's whereafter

 

    1. whereas whereby wherein whereupon wherever

 

    1. whether which while whither who

 

    1. who's whoever whole whom whose

 

    1. why will willing wish with

 

    1. within without won't wonder would

 

    1. wouldn't yes yet you you'd

 

    1. you'll you're you've your yours

 

    1. yourself yourselves zero



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值