Search code examples
magentoindexingdenormalization

How can I programmatically rebuild the Magento product flat data for a single, specified store view?


I'm running a multi-store installation of Magento and I've reached the point where my manual product imports and the subsequent index rebuild is taking too long. I want to stagger the jobs but need to know how to isolate the rebuilding of the indeces on a per-site basis.


Solution

  • $indexer = Mage::getResourceModel('catalog/product_flat_indexer')
    /* @var $indexer Mage_Catalog_Model_Resource_Product_Flat_Indexer */
    
    $indexer->rebuild(store_id);