Magento EE 1.13.0.2 部分重新索引


Magento EE 1.13.0.2 partial reindex

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

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

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

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

我尝试手动截断 url 重写相关表(像这样(,但它只是搞砸了一切,所以我恢复了数据库。

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

我的解决方案是使用以下查询重建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)

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/