get All Index process collection
$allIndex= Mage::getSingleton('index/indexer')->getProcessesCollection();
foreach ($allIndex as $index) {
if ($index->getStatus() == Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX) {
$index->reindexEverything();
//echo "<pre>"; print_r($index->getProcess_id()); echo "</pre>";
}
}
No comments:
Post a Comment