【问题标题】:Magento EE 1.13.0.2 partial reindexMagento EE 1.13.0.2 部分重新索引
【发布时间】:2013-12-23 17:06:12
【问题描述】:

我在 EE 中遇到了 magento 部分重新索引的问题。当索引器设置为保存时(在系统->配置->(高级)索引管理中),url_rewrites 不会更新。

如果我在后端保存了一个产品,然后在表 enterprise_catalog_product_rewrite 中查看该产品没有条目,我猜因此在 enterprise_url_rewrite 中没有条目,这意味着它不起作用。

我可以在列表中看到产品,但 url 对 SEO 不友好,如果在浏览器中输入 url 键,它将不会显示产品。

我一直在搜索有关此部分索引如何工作的信息,但似乎除了它有多好之外什么都没有。

我尝试过手动截断 url 重写相关表 (like this),但它只是把一切都搞砸了,所以我恢复了数据库。

【问题讨论】:

    标签: php magento url-rewriting indexing magento-1.13


    【解决方案1】:

    我遇到了同样的问题,catalog_product_entity_url_key 将包含每个商店的正确数据,enterprise_url_rewrite 将包含正确的 request_path > target_path 对。但是不会发生匹配,因为enterprise_catalog_product_rewrite 缺少给定产品的条目,或者有一个指向url_rewrite_id 的条目在enterprise_url_rewrite 中不再存在。

    我的解决方案是使用此查询重建 enterprise_catalog_product_rewrite 表:

    REPLACE INTO enterprise_catalog_product_rewrite
    (`product_id`, `store_id`, `url_rewrite_id`)
    (SELECT cpeuk.entity_id as product_id, cpeuk.store_id, eur.url_rewrite_id
    FROM catalog_product_entity_url_key cpeuk
    INNER JOIN enterprise_url_rewrite eur
    ON cpeuk.value = eur.identifier)
    

    【讨论】:

      【解决方案2】:

      Magento CE 1.8 的新 UNIQUE 索引更改了 URL 重写表中的 URL 键。如果您有多个商店视图并导入您的产品(以便为每个商店视图保存 URL 密钥),您将自动拥有重复的密钥。更新脚本足够聪明,不会抛出错误,而是重命名所有键,因此您最终会得到如下内容:

       - http://de.example.com/someproduct.html
       - http://en.example.com/someproduct1.html
       - http://nl.example.com/someproduct2.html
      

      为避免这种情况,必须在更新之前修复 URL 重写,以便每个产品和 URL 键有一次重写,并且商店视图使用“使用默认值”。您可以在更新前使用单个 SQL 查询来管理它:

      DELETE nondefault
      FROM catalog_product_entity_varchar AS nondefault
      INNER JOIN catalog_product_entity_varchar AS def ON def.value = nondefault.value
      AND def.entity_id = nondefault.entity_id
      WHERE def.attribute_id =86
      AND nondefault.attribute_id =86
      AND nondefault.store_id <>0
      AND def.store_id =0
      

      请注意,86 是 URL 键属性的 ID。 如果您在没有先运行此查询的情况下更新了系统,则必须先删除错误创建的 URL 键。这可以通过以下查询来完成:

      DELETE url_table
      FROM catalog_product_entity_url_key url_table
      INNER JOIN catalog_product_entity_varchar old_url_table ON url_table.store_id = old_url_table.store_id
      AND url_table.store_id <>0
      AND old_url_table.store_id <>0
      AND url_table.attribute_id = old_url_table.attribute_id
      AND url_table.entity_id = old_url_table.entity_id;
      

      我希望这会有所帮助!如果您还有其他问题,以下链接可能会对您有所帮助: http://www.code4business.de/update-magento-enterprise-edition-1-13-0-2/

      【讨论】:

        猜你喜欢
        • 2014-02-14
        • 1970-01-01
        • 1970-01-01
        • 2014-12-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多