[英]Magento 2.1 re-indexing issue
I am using Magento 2.1 我正在使用Magento 2.1
I have an issue that after i re-index products get hidden. 我有一个问题,在我重新索引产品后将其隐藏。 I do have a work around but this is not good.
我确实有解决方法,但这不好。 Let me explain how I reproduce error then what i do to fix.
让我解释一下如何重现错误,然后解决问题。
I can fix this by doing the following 1. run this sql query to disable all products UPDATE catalog_product_entity_int SET value =0 WHERE attribute_id =94 我可以通过以下步骤解决此问题:1.运行此sql查询以禁用所有产品UPDATE catalog_product_entity_int SET值= 0 WHERE attribute_id = 94
run re-index command php bin/magento indexer:reindex 运行重新索引命令php bin / magento indexer:reindex
run sql query to enable all products UPDATE catalog_product_entity_int SET value =1 WHERE attribute_id =94 运行sql查询以启用所有产品UPDATE catalog_product_entity_int SET值= 1 WHERE attribute_id = 94
run re-index command php bin/magento indexer:reindex 运行重新索引命令php bin / magento indexer:reindex
run this command (twice) php bin/magento cron:run php bin/magento cron:run 运行此命令(两次)php bin / magento cron:run php bin / magento cron:run
then all products display again. 然后所有产品再次显示。 but if i run re-index again I have to repeat steps i to 5 to get working again which is not very good.
但是,如果我再次运行重新索引,则必须重复步骤5至5才能重新工作,这不是很好。
I also notice that the below 2 commands cause the issue, all other index commands run seperatly cause no problems php bin/magento indexer:reindex catalog_category_product php bin/magento indexer:reindex catalog_product_category 我还注意到以下2个命令导致了此问题,所有其他索引命令单独运行不会导致任何问题php bin / magento indexer:reindex catalog_category_product php bin / magento indexer:reindex catalog_product_category
How can I fix this permanently? 如何永久解决此问题? any ideas
有任何想法吗
I resolved this issue after completely clearing all products (truncating MYSQL) I did the following two steps 在完全清除所有产品(截断MYSQL)后,我解决了此问题,我做了以下两个步骤
Followed the details in the below link to truncate all tables that to delete all data ready for re-import. 按照下面链接中的详细信息截断所有表,以删除准备重新导入的所有数据。 Obviously get a back up of your data to re-import first
显然,要先备份数据以重新导入
Checked mysql and truncated all tables in mysql beginning with 'catalog_' EXCEPT catalog_product_link_type 检查mysql并截断mysql中所有以'catalog_'开头的表(不包括catalog_product_link_type)
3.logeed in as ssh and ran the following commands cd public_html php -f bin/magento indexer:reindex 3.以ssh身份登录并运行以下命令cd public_html php -f bin / magento indexer:reindex
rm -rf var/di mkdir var/di rm -rf var/generation mkdir var/generation cd pub/static rm -rf _cache rm -rf deployed_version.txt rm -rf frontend rm -rf _requirejs rm -rf adminhtml cd .. cd .. php -f bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy php -f bin/magento cache:clean php -f bin/magento cache:flush php -f bin/magento indexer:reindex rm -rf var / di mkdir var / di rm -rf var / generation mkdir var / generation cd pub / static rm -rf _cache rm -rf deployed_version.txt rm -rf前端rm -rf _requirejs rm -rf adminhtml cd .. cd .. php -f bin / magento设置:升级php bin / magento设置:di:编译php bin / magento设置:静态内容:部署php -f bin / magento缓存:clean php -f bin / magento缓存:flush php -f bin / magento索引器:重新索引
That worked for me, just started cleared the database and all files ready for re-import 这对我有用,刚刚开始清除数据库,所有文件都准备好重新导入
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.