MATCH (Col1,col2,...) Against (expr [in BOOLEAN MODE | With QUERY expansion])
MySQL supports Full-text indexing and search capabilities. The index of the Full-text indexed type fulltext in MySQL. Fulltext indexes can be used only for MyISAM tables; they can be created as part of a CREATE TABLE statement from a char, varchar, or text column, or subsequently added using ALTER TABLE or CREATE INDEX. For a larger dataset, enter your data into a table without a Fulltext index, and then create an index that is faster than entering the data into the existing Fulltext index.
Full-text search is performed with the match () function.
Mysql> CREATE TABLE articles (
-> ID INT UNSIGNED auto_increment not NULL PRIMARY KEY,
-> title VARCHAR (200),
-> Body TEXT,
-> Fulltext (Title,body)
->);
Query OK, 0 rows Affected (0.00 sec)
Mysql> INSERT into articles (Title,body) VALUES
-> (' MySQL Tutorial ', ' DBMS stands for DataBase ... '),
-> (' How to use MySQL ok ', ' after you went through a ... '),
-> (' Optimizing MySQL ', ' in this tutorial we'll show ... '),
-> (' 1001 MySQL Tricks ', ' 1. Never run mysqld as root. 2... '),
-> (' MySQL vs. Yoursql ', ' in the following database comparison ... '),
-> (' MySQL security ', ' when configured properly, MySQL ... ');
Query OK, 6 rows Affected (0.00 sec)
Records:6 duplicates:0 warnings:0
Mysql> SELECT * from articles
-> WHERE MATCH (title,body) against (' database ');
+----+-------------------+------------------------------------------+
| ID | Title | Body |
+----+-------------------+------------------------------------------+
| 5 | MySQL vs. Yoursql | In the following database comparison ... |
| 1 | MySQL Tutorial | DBMS stands for DataBase ... |
+----+-------------------+------------------------------------------+
2 rows in Set (0.00 sec)