Magento – reindex product attributes error

Home / Blog / Magento – reindex product attributes error

Rozwiązanie błędu reindeksacji indeksu catalog_product_attribute. Wystarczy wyczyścić bazę danych z ‚pustych’ wpisów, np. Magento chce dodać do tabeli catalog_product_index_eav produkty, których już nie ma w sklepie.

delete from `catalog_category_product` WHERE product_id not in (select entity_id from catalog_product_entity);
delete from `catalog_category_product` WHERE category_id not in (select entity_id from catalog_category_entity);
delete from `catalog_product_website` WHERE product_id not in (select entity_id from catalog_product_entity);
delete from `catalog_product_entity_media_gallery` WHERE entity_id not in (select entity_id from catalog_product_entity);
delete from `catalog_product_index_eav_idx` WHERE entity_id not in (select entity_id from catalog_product_entity);
delete from `catalog_product_index_eav` WHERE entity_id not in (select entity_id from catalog_product_entity);
delete from `catalog_product_link` WHERE product_id not in (select entity_id from catalog_product_entity);
delete from `catalog_product_relation` WHERE parent_id not in (select entity_id from catalog_product_entity);