content_image/795445.jpg
•If the prefix term of a wildcard search is shorter than ngram token size, the query returns all indexed rows that contain ngram tokens starting with the prefix term. For example, assuming ngram_token_size=2 , a search on “a*”  returns all rows starting with “a” . 

•If the prefix term of a wildcard search is longer than ngram token size, the prefix term is converted to an ngram phrase and the wildcard operator is ignored. For example, assuming ngram_token_size=2 , an “abc*”  wildcard search is converted to “ab bc” . 

## ngram Parser Phrase Search 

Phrase searches are converted to ngram phrase searches. For example, The search phrase “abc”  is converted to “ab bc” , which returns documents containing “abc”  and “ab bc” . 

The search phrase “abc def”  is converted to “ab bc de ef” , which returns documents containing “abc def” and “ab bc de ef” . A document that contains “abcdef”  is not returned. 

## 12.10.9 MeCab Full-Text Parser Plugin 

The built-in MySQL full-text parser uses the white space between words as a delimiter to determine where words begin and end, which is a limitation when working with ideographic languages that do not use word delimiters. To address this limitation for Japanese, MySQL provides a MeCab full-text parser plugin. The MeCab full-text parser plugin is supported for use with InnoDB  and MyISAM . 

<img src='content_image/795445.jpg'>

## Note 

MySQL also provides an ngram full-text parser plugin that supports Japanese. For more information, see Section 12.10.8, “ngram Full-Text Parser” . 

The MeCab full-text parser plugin is a full-text parser plugin for Japanese that tokenizes a sequence of text into meaningful words. For example, MeCab tokenizes “ データベース管理 ”  (“Database Management” ) into “ データベース ”  (“Database” ) and “ 管理 ”  (“Management” ). By comparison, the ngram full-text parser tokenizes text into a contiguous sequence of n  characters, where n  represents a number between 1 and 10. 

In addition to tokenizing text into meaningful words, MeCab indexes are typically smaller than ngram indexes, and MeCab full-text searches are generally faster. One drawback is that it may take longer for the MeCab full-text parser to tokenize documents, compared to the ngram full-text parser. 

The full-text search syntax described in Section 12.10, “Full-Text Search Functions”  applies to the MeCab parser plugin. Differences in parsing behavior are described in this section. Full-text related configuration options are also applicable. 

For additional information about the MeCab parser, refer to the MeCab: Yet Another Part-of-Speech and Morphological Analyzer project on Github. 

## Installing the MeCab Parser Plugin 

The MeCab parser plugin requires mecab  and mecab-ipadic . 

On supported Fedora, Debian and Ubuntu platforms (except Ubuntu 12.04 where the system mecab version is too old), MySQL dynamically links to the system mecab  installation if it is installed to the default location. On other supported Unix-like platforms, libmecab.so  is statically linked in libpluginmecab.so , which is located in the MySQL plugin directory. mecab-ipadic  is included in MySQL binaries and is located in MYSQL_HOME \lib\mecab . 

You can install mecab  and mecab-ipadic  using a native package management utility (on Fedora, Debian, and Ubuntu), or you can build mecab  and mecab-ipadic  from source. For information about 

