Full-text searching is performed using MATCH() AGAINST()  syntax. MATCH()  takes a comma-separated list that names the columns to be searched. AGAINST  takes a string to search for, and an optional modifier that indicates what type of search to perform. 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: 

•A natural language search interprets the search string as a phrase in natural human language (a phrase in free text). There are no special operators, with the exception of double quote (") characters. The stopword list applies. For more information about stopword lists, see Section 12.10.4, “Full-Text Stopwords” . 

Full-text searches are natural language searches if the IN NATURAL LANGUAGE MODE  modifier is given or if no modifier is given. For more information, see Section 12.10.1, “Natural Language Full-Text Searches” . 

•A boolean search interprets the search string using the rules of a special query language. The string contains the words to search for. It can also contain operators that specify requirements such that a word must be present or absent in matching rows, or that it should be weighted higher or lower than usual. Certain common words (stopwords) are omitted from the search index and do not match if present in the search string. The IN BOOLEAN MODE  modifier specifies a boolean search. For more information, see Section 12.10.2, “Boolean Full-Text Searches” . 

•A query expansion search is a modification of a natural language search. The search string is used to perform a natural language search. Then words from the most relevant rows returned by the search are added to the search string and the search is done again. The query returns the rows from the second search. The IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION  or WITH QUERY EXPANSION modifier specifies a query expansion search. For more information, see Section 12.10.3, “Full-Text Searches with Query Expansion” . 

For information about FULLTEXT  query performance, see Section 8.3.5, “Column Indexes” . 

For more information about InnoDB FULLTEXT  indexes, see Section 15.6.2.4, “InnoDB Full-Text Indexes” . 

Constraints on full-text searching are listed in Section 12.10.5, “Full-Text Restrictions” . 

The myisam_ftdump  utility dumps the contents of a MyISAM  full-text index. This may be helpful for debugging full-text queries. See Section 4.6.3, “myisam_ftdump — Display Full-Text Index information” . 

## 12.10.1 Natural Language Full-Text Searches 

By default or with the IN NATURAL LANGUAGE MODE  modifier, the MATCH()  function performs a natural language search for a string against a text collection . A collection is a set of one or more columns included in a FULLTEXT  index. The search string is given as the argument to AGAINST() . For each row in the table, MATCH()  returns a relevance value; that is, a similarity measure between the search string and the text in that row in the columns named in the MATCH()  list. 

mysql> CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ) ENGINE=InnoDB; Query OK, 0 rows affected (0.08 sec) mysql> INSERT INTO articles (title,body) VALUES (’MySQL Tutorial’,’DBMS stands for DataBase ...’), (’How To Use MySQL Well’,’After you went through a ...’), (’Optimizing MySQL’,’In this tutorial, we show ...’), 

