Magento-禁用特定存储的索引器

Magento-禁用特定存储的索引器,magento,indexing,magento-1.x,Magento,Indexing,Magento 1.x,我只为订单使用5个商店(没有前端,只有后端) 有没有办法禁用特定存储id的索引器进程(特别是目录\u产品\u平面和目录\u搜索)?您不能在配置中禁用它。对于平面索引很容易做到,您必须更新它创建的循环 \Mage_Catalog_Model_Product_Indexer_Flat::_processEvent 下一步是: \Mage_Catalog_Model_Product_Flat_Indexer 下一步是: \Mage_Catalog_Model_Resource_Product_Fl

我只为订单使用5个商店(没有前端,只有后端)


有没有办法禁用特定存储id的索引器进程(特别是目录\u产品\u平面和目录\u搜索)?

您不能在配置中禁用它。对于平面索引很容易做到,您必须更新它创建的循环

\Mage_Catalog_Model_Product_Indexer_Flat::_processEvent
下一步是:

\Mage_Catalog_Model_Product_Flat_Indexer
下一步是:

\Mage_Catalog_Model_Resource_Product_Flat_Indexer
现在,主要函数之一(此函数调用rebuild函数并将数据填充到表中):

最后一个电话:

\Mage_Catalog_Model_Resource_Product_Flat_Indexer::rebuild
函数中有一个循环:

public function rebuild($store = null)
{
    if ($store === null) {
        foreach (Mage::app()->getStores() as $store) {
            $this->rebuild($store->getId());
        }
        return $this;
    }
如果更新此循环,可以从平面索引器跳过所需的存储。功能的位置是:
app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php:121

全文搜索索引的逻辑非常相似:
\Mage\u CatalogSearch\u Model\u Resource\u Fulltext::rebuildIndex

为什么要使用此功能,能否提供更多详细信息?重新索引这些数据需要很长时间(~1小时),我在用户使用搜索表单时遇到许多“一般错误:超过1205锁定等待超时;尝试重新启动事务”。我也收到一些订单失败。如果我为9个存储中的5个禁用索引器…您是否从Magento管理面板重新编制索引?否,仅从“php shell/indexer.php”和“getModel('index/indexer')->reindex”
public function rebuild($store = null)
{
    if ($store === null) {
        foreach (Mage::app()->getStores() as $store) {
            $this->rebuild($store->getId());
        }
        return $this;
    }