When is automatic partial reindexing performed in Magento EE 1.13?

Magento 1.13 has added partial indexing for most indexes, along with the ability to defer the indexing process to a cron job that runs asynchronously.

My question is, is there an existing cron job that does this or is this what I need to configure myself?

The documentation for this is not clear: http://www.magentocommerce.com/knowledge-base/entry/ee113-indexing#reindex-options

  • Scheduled update to schedule reindexing using the Magento cron job.
  • The change occurs either within a minute, or in accordance with the cron schedule.

This leads me to believe in the existence of an existing process that runs every time cron runs.

I see the index cleaner schedule, but only appears to clear old entries in the change log tables. Actually this is not like indexing.

I cannot find a cron job in the base code that runs these indexes.

+6
source share
1 answer

I think I found it. 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; } 

This is executed β€œalways” every time cron is executed. It performs full re-indexes for indexes that need and processes a change log for those who do not.

+9
source

All Articles