Friday, February 25, 2011

Full text indexing in mysql

All of you know searching option to site was one of the main big hand to viewers to stay on our site.hope all as know the success of google, yes the main success of google was search algorithm.but for a single site we don't want to create that kind of big search algorithm development , MySQL give one of the best option to search the content.

That was indexing, indexing used for speed up the query result.here i am going to explain full text indexing.
MySQL support FULLTEXT indexing from version 3.23.2.using full text intexing we acan able to give best search result with in our site.


NOTE :Full text index only support with MyISAM tables, and the columns should only with CHAR,VARCHAR or TEXT.


How to add full text index to MySQL table:

   we have three was to add Fulltext index in table, before that we must need to check where the table engine in 'MyISAM' type. if it not we are not able to add fulltext indexing.

Then how to change table engine, if you have an idea no problem , if not please click here.

adding full text indexing to column just use this on

ALTER TABLE tablename ADD FULLTEXT(colum name);

   * more than one column just use comma separated in column name.

once full text index created , we can able to search MATCH and AGAINST statement and it will use to in
dex based serach result.

Couple of mainthings to know about full text indexing:
------------------------------------------------------

*) Search word minimum length is 4 characters and case sensitive
*)  it give delayed to load data into a table
            insert query works fine but update it take some time.

No comments:

Post a Comment