I try to add full text search to an existing table. When I tried:
alter table tweets add fulltext index(tags);
I got the error:
ERROR 1214 (HY000): The used table type doesn't support FULLTEXT indexes
what is the problem? How can I know what table type it is?
This is how you check the table type:
Only
MyISAMsupportsFULLTEXT Indexes.You may also want to preempt the stopword list.
Click Here for the Stop Words that
FullText IndexingWould Normally Ignore.You can override this as Follows:
1) Create a text file in
/var/lib/mysqllike this2) Add this to
/etc/my.cnf3) service mysql restart
Here is something else to consider:
You may not want to convert the table ‘tweets’ to
MyISAM.1) If the
InnoDBtable ‘tweets’ containsCONSTRAINT(s).2) If the
InnoDBtable ‘tweets’ is the parent of otherInnoDBtables with Foreign Key Constraints back to ‘tweets’.3) You cannot afford to have table-level locking of the ‘tweets’ table.
Remember, each
INSERTinto the ‘tweets’ table will trigger a table-level lock if it were aMyISAMtable. Since it currently anInnoDBtable (which does row-level locking), the ‘tweets’ table can beINSERTedinto very quickly.You many want to create a separate
MyISAMtable, calledtweets_tags, with the same Primary Key of the ‘tweets’ table along with aTEXTcolumn called ‘tags’ the same as in the ‘tweets’ table.Next, do an initial load of tweets_tags like this:
Then, periodically (every night or every 6 hours), load new tweets into tweets_tags like this :