You can use such a model in the index module.
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection(); $processes->walk('reindexAll');
Since you need to rebuild all indexes, there are no filters associated with the collection. But you can filter the list of index processes by a set of parameters (code, last reindexed, etc.) using the addFieldToFilter($field, $condition)
method.
Little suggestion
It would be great to set the indexes in manual mode when importing products, this will help you speed up the import process, because some of them observe a product saving event, so it takes some time. You can do it as follows:
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection(); $processes->walk('setMode', array(Mage_Index_Model_Process::MODE_MANUAL)); $processes->walk('save'); // Here goes your // Importing process // ................ $processes->walk('reindexAll'); $processes->walk('setMode', array(Mage_Index_Model_Process::MODE_REAL_TIME)); $processes->walk('save');
Ivan Chepurnyi
source share