Fulltext Search in MySQL
Posted On domingo, 29 de marzo de 2009 at en 10:46 by Jaime LaraWe can search text in a database using a index option
in MySQL.
The FULLTEXT search only can be used in tables MyISAM.
For Example:
CREATE TABLE 'Example' (
'id' int(10) unsigned NOT NULL auto_increment,
'title' varchar(200) NOT NULL,
'description' text NOT NULL,
'image' longblob,
PRIMARY KEY ('id'),
FULLTEXT KEY 'textual search' ('title','description')
) ENGINE=MyISAM
Here is an example of how we can do a simple
boolean retrival query in MySQL
SELECT title,image
FROM example
WHERE MATCH(title, description)
AGAINST ('What are we looking' IN BOOLEAN MODE)
More information in: