12.10 Full-Text Search Functions全文搜索功能

12.10.1 Natural Language Full-Text Searches自然语言全文搜索
12.10.2 Boolean Full-Text Searches布尔全文搜索
12.10.3 Full-Text Searches with Query Expansion带查询扩展的全文搜索
12.10.4 Full-Text Stopwords全文停止字
12.10.5 Full-Text Restrictions全文局限性
12.10.6 Fine-Tuning MySQL Full-Text Search微调MySQL全文搜索
12.10.7 Adding a User-Defined Collation for Full-Text Indexing为全文索引添加用户定义的排序规则
12.10.8 ngram Full-Text Parserngram全文分析器
12.10.9 MeCab Full-Text Parser PluginMeCab全文解析器插件

MATCH (col1,col2,...) AGAINST (expr [search_modifier])

search_modifier:
  {
       IN NATURAL LANGUAGE MODE
     | IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION
     | IN BOOLEAN MODE
     | WITH QUERY EXPANSION
  }

MySQL has support for full-text indexing and searching:MySQL支持全文索引和搜索:

Full-text searching is performed using MATCH() AGAINST() syntax. 全文搜索是使用MATCH() AGAINST()语法执行的。MATCH() takes a comma-separated list that names the columns to be searched. MATCH()采用逗号分隔的列表来命名要搜索的列。AGAINST takes a string to search for, and an optional modifier that indicates what type of search to perform. AGAINST接受一个要搜索的字符串和一个可选的修饰符,该修饰符指示要执行的搜索类型。The search string must be a string value that is constant during query evaluation. 搜索字符串必须是在查询求值期间保持不变的字符串值。This rules out, for example, a table column because that can differ for each row.例如,这排除了表列的可能性,因为每行的表列可能不同。

There are three types of full-text searches:全文搜索有三种类型:

For information about FULLTEXT query performance, see Section 8.3.5, “Column Indexes”.有关FULLTEXT查询性能的信息,请参阅第8.3.5节,“列索引”

For more information about InnoDB FULLTEXT indexes, see Section 15.6.2.4, “InnoDB Full-Text Indexes”.有关InnoDB全文索引的更多信息,请参阅第15.6.2.4节,“InnoDB全文索引”

Constraints on full-text searching are listed in Section 12.10.5, “Full-Text Restrictions”.全文搜索的局限性在第12.10.5节“全文限制”中列出。

The myisam_ftdump utility dumps the contents of a MyISAM full-text index. myisam_ftdump实用程序转储MyISAM全文索引的内容。This may be helpful for debugging full-text queries. 这可能有助于调试全文查询。See Section 4.6.3, “myisam_ftdump — Display Full-Text Index information”.请参阅第4.6.3节,“myisam_ftdump——显示全文索引信息”

12.10.1 Natural Language Full-Text Searches
12.10.2 Boolean Full-Text Searches
12.10.3 Full-Text Searches with Query Expansion
12.10.4 Full-Text Stopwords
12.10.5 Full-Text Restrictions
12.10.6 Fine-Tuning MySQL Full-Text Search
12.10.7 Adding a User-Defined Collation for Full-Text Indexing
12.10.8 ngram Full-Text Parser
12.10.9 MeCab Full-Text Parser Plugin