0

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

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

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

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

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

4

2 回答 2

4

我有同样的问题,其中catalog_product_entity_url_key将包含每个商店的正确数据,并且enterprise_url_rewrite将包含正确的request_path > target_path对。但是不会发生匹配,因为enterprise_catalog_product_rewrite缺少给定产品的条目,或者有一个指向 a 的条目url_rewrite_identerprise_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)
于 2015-04-24T05:32:52.040 回答
0

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-06-18T11:33:47.707 回答