Refresh all magento indexes
Jun 17, 2011 · 1 minute readCategory: magento
The indexes for your Magento site should be refreshed on a regular basis. To help you do this you can put the below code in a PHP file in the root of your web site and setup a scheduled task to call it periodically.
require_once 'app/Mage.php';
$app = Mage::app('admin');
umask(0);
for ($i = 1; $i <= 8; $i++) {
$process = Mage::getModel('index/process')->load($i);
$process->reindexAll();
}