MySQL Full-Text Search: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "==Configure full-text search== *Create a fulltext index on the table to be searched. *Table must us MyISAM engine to support fulltext indexes. *Using MySQL Workbench **Alter T...")
(No difference)

Revision as of 17:58, 24 February 2012

Configure full-text search

  • Create a fulltext index on the table to be searched.
  • Table must us MyISAM engine to support fulltext indexes.
  • Using MySQL Workbench
    • Alter Table > Table tab > Engine: MyISAM
    • Alter Table > Indexes tab > Index Name: FT_whatever > Type: FULLTEXT > select columns

Performing full-text search

SELECT cn1, cn2,... FROM table WHERE (MATCH(c1,c2,...) AGAINST ('searchterm' IN BOOLEAN MODE))

MySQL Database types

MyISAM

  • Full-text search

InnoDB

  • Default table type when creating a new table in MySQL
  • More resource intensive
  • Supports foreign keys
  • Faster performance (doesn't lock tables for reads & writes)
  • Supports transactions
  • Does not support full-text search