Magento – Catalog Search Index Not Changing Status ‘Required Index’ Fix

catalogsearchindexing

I ran many time reindex process and system always returning the status "required index". I truncate the table without success.

Best Answer

Check which events set the indexes to invalid

Magento docs show the events for every index (see Events that Trigger Reindexing):

Further you can add some debug code in Mage_Index_Model_Resource_Process::updateStatus()

if ($status === Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX) {
    Mage::log(sprintf('Indexer %s was invalidated.', $process->getIndexer()->getName()), null, 'invalid_index.log', true);
    foreach (debug_backtrace() as $db) {
        Mage::log(sprintf('%s::%s', $db['class'], $db['function']), null, 'invalid_index.log', true);
    }
}

This should show you a stack trace about what is setting the indexes to invalid. In my case it were API requests of 'catalogProductUpdate'

You can also check the exception.log if you'll find any locks of the 'index_process' table. This tables holds the data you see in System > Index Management

Creds for the debug code go here