Problem: MySQL search for a long time is not ideal for Chinese, InnoDB engine support for Fulltext index is a new feature introduced by MySQL5.6, but the word "beginner" in the "I am a junior developer" search is not possible results, because the search is empty glyd participle. Therefore, search tasks can only be done by third-party plug-ins. In MySQL 5.7.6 we can use a new full-text indexing plug-in to process them: N-gram parser.
1 installation environment, it is recommended to use the latest MySQL Https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-winx64.zip
2 ngram_token_size=2 #用中文检索分词插件ngram之前, the size of his participle must be set in the MySQL config file first.
Case of word ' information system ' when set to different values
Ngram_token_size= 1 : ' faith ' Span class= "Crayon-sy" >, ", "system" , ngram_token_size=2 : ' information ', ' interest ', ' system ';
ngram_token_size=3 : ' Information Department ', ' system of interest ';
ngram_token_size=4 : ' information Systems ';
View the specified full-text index table source (view word breakers only, do not do, do not affect the index)
Set global innodb_ft_aux_table= ' db/table '; SELECT * from INFORMATION_SCHEMA. ' Innodb_ft_index_table ';
3 Full-Text indexing established
A new
CREATE table Table ( ' id ' int (one) default null, ' name ' varchar) default NULL, ' content ' text, Fulltext key Idx_name (name), fulltext key idx_content (content) with PARSER ngram) Engine=innodb DEFAULT Charset=utf8 ;
B Modification
2017MySQL Chinese Index resolution Natural Language processing (N-gram parser)