You can create a second table using MyISAM that contains only the primary key of the main table and the text content you wish to FULLTEXT
search over. Then when you want to do a fulltext search, you do a JOIN
between the proper InnoDB table, and the search-bait MyISAM table, with a MATCH
condition against the MyISAM table.
This also allows you to store different search-bait text in the MyISAM table to the ‘real’ text in the InnoDB table, which allows you implement features like stemming or special apostrophe/hyphen handling that MySQL's FULLTEXT
engine can't manage.
The problem here of course is keeping the MyISAM data consistent with the InnoDB data. You can either run a job every so often to do it, or make the app write to both tables any time there is a text update. Either way, hopefully you can get away with inconsistency in fulltext searching, where it would be unacceptable for the ‘canonical’ table data.
Another approach is just to fall back to LIKE
/RLIKE
(regexp) matching when the fulltext solution you want isn't available. Will be unindexable so not fast, but at least it'll always work, and it's fine for smaller databases.
Edit:
the table on which I want to perform search contains the list of instruments that exist in the lab for which I am building the web application
OK, does that really have to be FULLTEXT
searchable? Wouldn't it be better to model such a list as one entity per type of equipment, and a join table between labs and equipments (or whatever it is)?
so if 2 inserts happen at the same time?
MyISAM won't let two INSERT
s claim the same primary key. But this isn't enough to guarantee ‘consistency’ in the general case. Whilst it sounds like you could get away with it from a practical point of view, if there is a explicit requirement for ‘consistency’ that's probably exactly what they don't want you to do.