Once in a day, many products are not displayed in our shop anymore. This can be fixed by rebuilding catalog_category_product via command line and flushing all caches.

We found, that the Index table contains only around 4000 lines while it should be around 8000 when all products are displayed properly:

mysql> select count(*) from catalog_category_product_index;
| count(*) |
|     8586 |

This is our index configuration: (Enlarge)

Index Config

What can be the reason for the index getting corrupted on a regular basis?


It is not really once in a day. Happened once per day in the past week for three times, but not today.

  • Did you manage to figure out the problem? – dchayka Apr 13 '16 at 19:48
  • No, I did not manage to fix it. – Alex Apr 14 '16 at 11:37

This may not answer your question directly but may assist you looking in the same direction.

The issue I was experiencing is similar because Upsell products (both selected and rule-based) would disappear middle of the day at random times. I would re-save target based rule to build indexes and products would be re-instated, later that day or over night products would be removed from index once again.


Problem: in app/code/core/Enterprise/TargetRule/Model/Observer.php catalogProductAfterSave(Varien_Event_Observer $observer) which is triggered when product is being saved, all indexes related to target based rule are removed and expected to rebuild within the same function. Issue was that this function would remove an ID from enterprise_targetrule_product table which is required to rebuild the indexes once again (this has been fixed/refactored in later versions of Magento).

Solution: create new module, extend Core's app/code/core/Enterprise/TargetRule/Model/Observer.php model, override catalogProductAfterSave() function and remove line 73 ($indexResource->removeProductIndex($product->getId());).

This will prevent the system from removing matched product from the table which is required for rebuilding indexes but to generate a new set of matched products for the rule, saving a rule again will be required which is expected flow of the module.

Posting this in case someone else stubmles upon a similar problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.