In Magento When assigning products to (new) websites programmatically do I need to run an index and which one?

When using

Mage::getModel('catalog/product_website')->addProducts(array($set_to_store_id), $product->getId());
  1. Can I then programmatically trigger an index? (for the current $product)

  2. And if I would want to do it in the backend which index is it?


You need to do this reindexing programmatically :


If you want to do from admin, then you can also do it.

| improve this answer | |
  • Suppose I update the product. How can I mark the product as changed for this particular index (only) and make sure it gets reindexed. – snh_nl Aug 3 at 12:40
  • Or does the update using above code already trigger indexing implicitly – snh_nl Aug 3 at 12:42
  • you can try above thing, so you will get idea. – Dhiren Vasoya Aug 4 at 4:44

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.