Magento index update for one or more specific products

I want to know if there is a way to update the magento index for one or more products. So, for example, I have 100 products that I just programmatically updated the price ... and now I need to kick the indexer so that it recalculates the price for these 100 products. So just to be clear ...

I know you can just update one index for ALL products. For example, this will update the price index for all products:

$process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_price');


And I also know that it is possible to update ALL indexes of just one product (or multiple products if you do it in a loop):

  $product, Mage_Catalog_Model_Product::ENTITY, 


BUT, none of these options work for me. I need to be able to make a cross section of these two. How can I take one or more products and update only one index, like a price index?

I am working with Magento CE

EDIT: By the way, on Magento 1.3 I was able to accomplish this by following these steps, but it doesn't work anymore.




source to share

2 answers




Another idea:



This works for me:

$catalogSearchIndexer = Mage::getResourceSingleton('catalogsearch/fulltext');
$catalogSearchIndexer->rebuildIndex($storeId, $productIds);




If your index mode is set to manual, it still tracks all changes to index_event. You can index all pending changes with$process->indexEvents();



All Articles