Good way to re-index data in magento without admin panel is SSH.Also I have been locked in admin panel and unable to reindex all data the SSH is the good practice to do.Sometime if we don’t have access to SSH then we can do Reindexing magento programmatically.So please follow details instruction at first I have explained in the way of SSH and latter I have explained how we can managed through script or Programmatically.So lets see how to Manage magento re-index data by SSH or by programmatically.
1: First you can login into your SSH connection and then go to shell folder of magento installation.
2: Then get full list of magento indexer command.
Out put will be like :
3: Then do reindex data by.
4: If you like to reindex for some specific process then first check all reindex code available in magento.Basicall by default there are 9 reindex code present in magento.
Out put will be like :
5: so finally you can do your reindex process one by one if you like to do for specific process.
Generally by default magento provides 9 index processes. You can see the above result which I have shown the output from SSH command or you can see in index_process table.If you would like to update programmatically the use the indexer process codes which I have explained individually.
- catalog_product_attribute : Product Attributes (If you updated attributes which are used layered navigation)
- catalog_product_price : Product Prices (If you updated prices)
- catalog_url : Catalog URL Rewrites (If you updated Product or Catalag url)
- catalog_product_flat : Product Flat Data (If in your store you have used Flat tables and you updated product attributes which are used frontend logic)
- catalog_category_flat : Category Flat Data (If you updated category attributes)
- catalog_category_product : Category Products (If you added or removed products from catalog)
- catalogsearch_fulltext : Catalog Search Index (If you updated searchable attributes of product)
- cataloginventory_stock : Stock Status (If you updated stock options of product)
- tag_summary : Tag Aggregation Data (If you updated Product tag)
So lets start our coding part:
first you have to fetch the indexer model by Mage::getModel(‘index/indexer’) and use above code in the function getProcessByCode() as parameters.So finale code will be
For Product Attributes:
For Product Prices:
For Catalog URL Rewrites:
For Product Flat Data:
For Category Flat Data:
For Category Products:
For Catalog Search Index:
For Stock Status:
For Tag Aggregation Data:
Also if you would like to refresh all at once then use the following code.
And also after doing everything flush all the cache to get better result by .