Magento – Magento – Website/Store level indexing

indexing

We are working on Magento 1.7.0.2 (community). We have created multiple websites. Our query is, is there way to indexing on selected website or store? like website or store level configuration.

Consider the the scenario, we have 3 website (WEBSITE1, WEBSITE2, WEBSITE3) and 3 store (STORE1, STORE1, STORE1)
1. If we update WEBSITE1 and STORE1 then indexing will only for WEBSITE1 and STORE1.
2. If we update WEBSITE2 and STORE2 then indexing will only for WEBSITE2 and STORE2.
3. If we update WEBSITE3 and STORE3 then indexing will only for WEBSITE3 and STORE3.

Please help us.

Best Answer

You can try this.

<?php
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
umask(0);

// clean overall cache Mage::app()->cleanCache();
echo "Cache Cleaned!<br/>\n";

// clear 'refresh_layered_navigation'
$storeid = Mage::app()->getRequest()->getParam('storeid');

// Only process if a storeid is passed
if ($storeid) {
  $store = Mage::app()->getStore($storeid);
  Mage::getSingleton('catalogindex/indexer')->plainReindex(null, null, $store); 
  echo 'Layered Navigation Indices was refreshed succesfuly for Store Id: '.$storeid.'<br>';
}
?>