我想我找到了。 enterprise_refresh_index
<enterprise_refresh_index>
<schedule>
<cron_expr>always</cron_expr>
</schedule>
<run>
<model>enterprise_index/observer::refreshIndex</model>
</run>
</enterprise_refresh_index>
public function refreshIndex(Mage_Cron_Model_Schedule $schedule)
{
/** @var $helper Enterprise_Index_Helper_Data */
$helper = Mage::helper('enterprise_index');
/** @var $lock Enterprise_Index_Model_Lock */
$lock = Enterprise_Index_Model_Lock::getInstance();
if ($lock->setLock(self::REINDEX_FULL_LOCK)) {
/**
* Workaround for fatals and memory crashes: Invalidating indexers that are in progress
* Successful lock setting is considered that no other full reindex processes are running
*/
$this->_invalidateInProgressIndexers();
$client = Mage::getModel('enterprise_mview/client');
try {
//full re-index
$inactiveIndexes = $this->_getInactiveIndexersByPriority();
$rebuiltIndexes = array();
foreach ($inactiveIndexes as $inactiveIndexer) {
$tableName = (string)$inactiveIndexer->index_table;
$actionName = (string)$inactiveIndexer->action_model->all;
$client->init($tableName);
if ($actionName) {
$client->execute($actionName);
$rebuiltIndexes[] = $tableName;
}
}
//re-index by changelog
$indexers = $helper->getIndexers(true);
foreach ($indexers as $indexerName => $indexerData) {
$indexTable = (string)$indexerData->index_table;
$actionName = (string)$indexerData->action_model->changelog;
$client->init($indexTable);
if (isset($actionName) && !in_array($indexTable, $rebuiltIndexes)) {
$client->execute($actionName);
}
}
} catch (Exception $e) {
$lock->releaseLock(self::REINDEX_FULL_LOCK);
throw $e;
}
$lock->releaseLock(self::REINDEX_FULL_LOCK);
}
return $this;
}
這將運行 「永遠」 在每一個cron的執行。它爲需要的索引運行完整的重建索引,併爲那些不需要的索引處理更改日誌。