什么时候自动部分重建索引实际在Magento EE 1.13中运行?

kir*_*era 6 indexing magento magento-1.13

Magento 1.13为大多数索引添加了部分索引,并且能够将索引过程推迟到异步运行的cron作业.

那么我的问题是,是否存在一个现有的cron工作,或者这是我必须自己设置的东西?

文档不清楚:http: //www.magentocommerce.com/knowledge-base/entry/ee113-indexing#reindex-options

  • 计划安排使用Magento cron作业重新编制索引时更新.
  • 更改发生在分钟内或根据您的cron作业计划.

这让我相信它是每次cron运行时运行的现有进程.

我看到索引清理程序计划,但只显示清除更改日志表中的旧记录.它似乎没有实际做任何索引.

我似乎无法在运行这些索引的核心代码中找到一个cron作业.

kir*_*era 9

我想我找到了.enterprise_refresh_index

<enterprise_refresh_index>
    <schedule>
        <cron_expr>always</cron_expr>
    </schedule>
    <run>
        <model>enterprise_index/observer::refreshIndex</model>
    </run>
</enterprise_refresh_index>
Run Code Online (Sandbox Code Playgroud)
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;
}
Run Code Online (Sandbox Code Playgroud)

这在每次执行cron时都会"始终"运行.它为需要的索引运行完全重新索引,并为那些不需要的索引处理更改日志.