如何通过重建索引来解决问题.Magento

时间:2016-04-20 15:05:25

标签: magento reindex

我刚刚使用自定义脚本重新索引数据,并生成此错误:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'abs', ( - i.price), IF( = 'fixed', , ROUND(i.price * ( / 100), 4)))), 0) AS `' at line 1

我试过制作catalog_product_flat_1表但仍然是同一个问题

4 个答案:

答案 0 :(得分:0)

可能是一系列潜在原因。

如果您有SSH访问权限,我建议您通过命令行重新编制索引 - 更强大:

cd pathtomagentoinstall/shell
php indexer.php --reindex

您准确添加了多少种产品?可能是超时问题,虽然我希望有一个不同的错误消息。

编辑 - 还要确保根类别设置正确:转到系统 - >管理商店并确保根类别设置为您正在使用的类别

答案 1 :(得分:0)

        You could try truncating those catalog_product_flat_* tables. Backup your database and then via MySQL console, phpMyAdmin or other MySQL client run the following:

truncate table ´catalog_product_flat_1´;
truncate table ´catalog_product_flat_2´;
truncate table ´catalog_product_flat_3´;



Do this for all catalog_product_flat_* tables. Then re-index the Product flat data index to rebuild / repopulate those tables.

答案 2 :(得分:0)

转到管理面板 - > 系统 - > 配置,然后点击左侧的管理商店,然后点击商店名称,点击主网站商店

选择根类别为默认类别。 (默认情况下,您可能会看到 - 请选择一个类别 - )

答案 3 :(得分:-1)

要解决此问题, 使用FTP或ssh,从项目根文件夹中,转到var / locks位置并删除该文件夹中的所有文件。 然后登录Magento Admin端并尝试重新编制索引。

如果这不能解决错误,只需转到ssh, 更改YourProjectRootFolder / shell的路径并输入命令 php indexer.php --reindex all

这将解决问题。