10bet网址
MySQL 8.0参考手册
相关的文档10bet官方网站 下载本手册
PDF(美国高级主任)- 41.2 mb
PDF (A4)- 41.3 mb
PDF (RPM)- 39.5 mb
HTML下载(TGZ)- 9.3 mb
HTML下载(Zip)- 9.3 mb
HTML下载(RPM)- 7.8 mb
手册页(TGZ)- 260.6 kb
手册页(Zip)- 371.8 kb
信息(Gzip)- 4.0 mb
信息(邮政编码)- 4.0 mb
本手册节选

12.10.4全文停止词

停止字列表使用服务器字符集和排序规则(字段的值)加载和搜索全文查询character_set_server而且collation_server系统变量)。如果用于全文索引或搜索的停止字文件或列具有不同的字符集或排序规则,则停止字查找可能会出现错误命中或遗漏character_set_servercollation_server

停止词查找的大小写敏感性取决于服务器的排序规则。例如,如果排序规则为,则查找是不区分大小写的utf8mb4_0900_ai_ci,而如果排序规则为,则查找是区分大小写的utf8mb4_0900_as_csutf8mb4_bin

InnoDB搜索索引的停止词

InnoDB有一个相对较短的默认停止词列表,因为来自技术、文学和其他来源的文档经常使用简短的单词作为关键字或重要的短语。例如,您可能会搜索生存还是毁灭并期望得到一个合理的结果,而不是让所有这些话都被忽略。

查看默认值InnoDB停止词列表,查询INFORMATION_SCHEMA。INNODB_FT_DEFAULT_STOPWORD表格

mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD+-------+ | 价值  | +-------+ | 大约一个| | | |的| |是| |是| |的| |是| |的| | com | |德| | en | |的| |的| | |如何我| | |中| |是| |是| | la |的| | |的| |和| |:| |的| |这| |,| |是| |是| |当| |中| |谁| |将| |和| |和| |的| | www  | +-------+ 36行集(0.00秒)

为所有人定义自己的停止词列表InnoDB表时,定义具有相同结构的表INNODB_FT_DEFAULT_STOPWORD表的值,用停止词填充它,并设置innodb_ft_server_stopword_table选项设置为窗体中的值db_name/table_name在创建全文索引之前。停止词表必须有一个单VARCHAR列命名价值.下面的示例演示创建和配置一个新的全局停止词表InnoDB

——创建一个新的停止词表mysql> Create table my_stopwords(value VARCHAR(30)) ENGINE = INNODB;mysql> Insert INTO my_stopwords(value) VALUES ('Ishmael');查询OK, 1 row affected (0.00 sec)——创建表mysql> Create table opening_lines (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, opening_line TEXT(500), author VARCHAR(200), title VARCHAR(200)) ENGINE=InnoDB;查询OK, 0行影响(0.01秒)——插入数据到表mysql> Insert into opening_lines(opening_line,author,title) VALUES ('Call me Ishmael。)、《赫尔曼·梅尔维尔》、《白鲸》)、(尖叫声响彻天际。’、‘品钦’、‘万有引力的彩虹’)、(‘我是一个隐形人。,“拉尔夫·埃里森”,“隐形人”),(“现在在哪里?”现在谁?现在什么时候?','Samuel Beckett','The Unnamable'), ('It was love at first sight.','Joseph Heller','Catch-22'), ('All this happened, more or less.','Kurt Vonnegut','Slaughterhouse-Five'), ('Mrs. Dalloway said she would buy the flowers herself.','Virginia Woolf','Mrs. Dalloway'), ('It was a pleasure to burn.','Ray Bradbury','Fahrenheit 451'); Query OK, 8 rows affected (0.00 sec) Records: 8 Duplicates: 0 Warnings: 0 -- Set the innodb_ft_server_stopword_table option to the new stopword table mysql> SET GLOBAL innodb_ft_server_stopword_table = 'test/my_stopwords'; Query OK, 0 rows affected (0.00 sec) -- Create the full-text index (which rebuilds the table if no FTS_DOC_ID column is defined) mysql> CREATE FULLTEXT INDEX idx ON opening_lines(opening_line); Query OK, 0 rows affected, 1 warning (1.17 sec) Records: 0 Duplicates: 0 Warnings: 1

验证指定的停止词('Ishmael')没有通过查询中的单词出现INFORMATION_SCHEMA。INNODB_FT_INDEX_TABLE

请注意

默认情况下,长度小于3个字符或长度大于84个字符的单词不会出现在InnoDB全文检索索引。最大和最小字长值可以使用innodb_ft_max_token_size而且innodb_ft_min_token_size变量。这个默认行为不适用于ngram解析器插件。Ngram令牌大小由ngram_token_size选择。

mysql> SET GLOBAL innodb_ft_aux_table='test/opening_lines';查询OK, 0行影响(0.00秒)mysql> SELECT word FROM INFORMATION_SCHEMAInnodb_ft_index_table limit 15;+-----------+ | 词  | +-----------+ | 在| |所有| |燃烧| |购买| |电话| |是| |史册。| |第一| | |花发生了| | | |她看不见| | |少| |喜欢| |男人  | +-----------+ 15行集(0.00秒)

若要逐表创建停止词列表,请创建其他停止词表并使用innodb_ft_user_stopword_table选项,在创建全文索引之前指定要使用的停止字表。

MyISAM搜索索引的停止词

停止字文件是使用加载和搜索latin1如果character_set_serverucs2utf16utf16le,或utf32

要覆盖MyISAM表的默认停止字列表,请设置ft_stopword_file系统变量。(见章节5.1.8,“服务器系统变量”)。变量值应该是包含停止字列表的文件的路径名,或者是禁用停止字过滤的空字符串。服务器在数据目录中查找文件,除非给出了绝对路径名来指定不同的目录。在更改此变量的值或停止字文件的内容之后,重新启动服务器并重新构建您的全文索引。

停止词列表是自由形式的,用任何非字母数字字符(如换行符、空格或逗号)分隔停止词。例外情况包括下划线字符(_)和一个撇号(),它们被视为单词的一部分。停止字列表的字符集是服务器的默认字符集;看到章节10.3.2,“服务器字符集和排序规则”

下面的列表显示了的默认停止词MyISAM搜索索引。在MySQL源代码发行版中,您可以在存储/ myisam / ft_static.c文件。

A能够在上面根据实际上穿越之后之后再对不是都允许允许几乎独自沿着已经也尽管总是在一个和另一个任何人,任何人,任何人,无论如何,无论如何,任何地方之间出现欣赏合适的是不在旁边,询问相关的在可用的离开非常成为因为成为成为成为之前之前在后面相信下面除了最好更好之间超越两者都简短,但由c'mon c的来可以不能不能不能引起原因某些肯定改变清楚co com来来来来关于因此考虑考虑包含包含对应的可能不能课程目前肯定描述尽管做了没有不同的做了做了不做不做不做不做向下向下在每个edu期间,例如八要么其他其他地方足够完全特别是等等,甚至每一个人每一个人每一个地方ex,确切的例子,除了far few fifth first five followed following follows for former formerly forth four from further furthermore get gets getting given gives go goes going gone got gotten greetings had hadn't happens hardly has hasn't have haven't having he he's hello help hence her here here's hereafter hereby herein hereupon hers herself hi him himself his hither hopefully how howbeit however i'd i'll i'm i've ie if ignored immediate in inasmuch inc indeed indicate indicated indicates inner insofar instead into inward is isn't it it'd it'll it's its itself just keep keeps kept know known knows last lately later latter latterly least less lest let let's like liked likely little look looking looks ltd mainly many may maybe me mean meanwhile merely might more moreover most mostly much must my myself name namely nd near nearly necessary need needs neither never nevertheless new next nine no nobody non none noone nor normally not nothing novel now nowhere obviously of off often oh ok okay old on once one ones only onto or other others otherwise ought our ours ourselves out outside over overall own particular particularly per perhaps placed please plus possible presumably probably provides que quite qv rather rd re really reasonably regarding regardless regards relatively respectively right said same saw say saying says second secondly see seeing seem seemed seeming seems seen self selves sensible sent serious seriously seven several shall she should shouldn't since six so some somebody somehow someone something sometime sometimes somewhat somewhere soon sorry specified specify specifying still sub such sup sure t's take taken tell tends th than thank thanks thanx that that's thats the their theirs them themselves then thence there there's thereafter thereby therefore therein theres thereupon these they they'd they'll they're they've think third this thorough thoroughly those though three through throughout thru thus to together too took toward towards tried tries truly try trying twice two un under unfortunately unless unlikely until unto up upon us use used useful uses using usually value various very via viz vs want wants was wasn't way we we'd we'll we're we've welcome well went were weren't what what's whatever when whence whenever where where's whereafter whereas whereby wherein whereupon wherever whether which while whither who who's whoever whole whom whose why will willing wish with within without won't wonder would wouldn't yes yet you you'd you'll you're you've your yours yourself yourselves zero