wiki:FulltextSearchIdeas

Version 2 (modified by lauer, 19 years ago) (diff)

--

for mysql, we need MyISAM tables

e.g. 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)