Question

I added a FULLTEXT index on three of my columns, after I already had a bunch of records...does that mean the FULLTEXT won't index them and will only index records inserted after the FULLTEXT index was added? If so, anyway to reindex the whole database?

Was it helpful?

Solution

When you do ALTER TABLE ADD INDEX, old records get indexed immediately (and new records get indexed as soon as they are INSERTed). That's true for FULLTEXT indexes as well.

Please note however, that sometimes (e.g. when you change options ft_min_word_len, ft_max_word_len, or ft_stopword_file) you have to rebuild a FULLTEXT index, see http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html for details.

OTHER TIPS

It's MySQL's responsibility, not yours, to ensure that indexes are consistent with the data they are indexing.

When you add an index on existing data, MySQL will build the index according to that existing data.

FULLTEXT indexes are no exception.

You should only need to rebuild an index if you suspect your table has been corrupted somehow, or you have done some other advanced tweaking to the way MySQL builds its indexes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top