wiki:FulltextSearchIdeas

for mysql, we need MyISAM tables

example table creation with FULLTEXT indexes

mysql> CREATE TABLE articles (
    ->   id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
    ->   title VARCHAR(200),
    ->   body TEXT,
    ->   FULLTEXT (title,body)
    -> );

example query:

mysql> SELECT * FROM articles
    -> WHERE MATCH (title,body) AGAINST ('database');

Hints from MySQL documentation:

Loading data into a table that has an existing FULLTEXT index could be significantly slower.

For large datasets, it is much faster to load your data into a table that has no FULLTEXT index, then create the index with ALTER TABLE (or CREATE INDEX)

Last modified 19 years ago Last modified on 06/17/05 16:44:19