Question

In magento version 1.7.0.2 whenever i tried to reindex data it takes long time and after that it will display 500 Internal Server Error.

500 Enternal Error

Was it helpful?

Solution

Try to re-index data by ssh

php indexer.php --reindex catalog_product_attribute
php indexer.php --reindex catalog_product_price
php indexer.php --reindex catalog_url
php indexer.php --reindex catalog_product_flat
php indexer.php --reindex catalog_category_flat
php indexer.php --reindex catalog_category_product
php indexer.php --reindex catalogsearch_fulltext
php indexer.php --reindex cataloginventory_stock
php indexer.php --reindex tag_summary

or for all

php -f indexer.php reindexall

Script for re-index data

<?php
require 'app/Mage.php';
Mage::app('default');

$indexCollection = Mage::getModel('index/process')->getCollection();
foreach ($indexCollection as $index) {
    $index->reindexAll();
}

Or for individual indexer code you can use below.

<?php
require 'app/Mage.php';
Mage::app('default');

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

OTHER TIPS

It seems the issue of execution timeout of your server, you can try extending it by yourself or by asking hosting provider. Meanwhile, This thread should help you with the reindexing issue, explains well how to do reindexing programmatically.

https://stackoverflow.com/questions/14827996/magento-reindexing-price-programmatically

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top