Animate y forma parte del Clan !!!

Fulltext Search in MySQL

We 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:

Posted in Etiquetas: , |

0 comentarios: