Magento is a perfect ecommerce platform solution for big shop online site, so that it must handle a site what have a lot of products. Let ‘s say we have 2000 products in a magento site and now we want to re-index magento to make it work faster when it access database.

The re-index function is already implemented in magento admin back end, so we don’t have to do any more step to get it done.

Login to back end and browse to menu System => Index Management and you will see this

magento index management


But the problem is your shop is too heavy, it can’t re-index everything just in one click or it have no enough time and execution resource to do any reindex action. So that ‘s why we have to use Command line. Luckily it ‘s quite easy.

First move to [MAGENTO_ROOT]/shell/ (This is the location where indexer.php is present.)

To check the status of all Indexes

php indexer.php --status

To Reindex all indexes

php indexer.php --reindexall

To Reindex particular index

php indexer.php --[Index Option Code]
Index Option Code Index Option Name
catalog_product_attribute Product Attributes
catalog_product_price Product Prices
catalog_url Catalog Url Rewrites
catalog_product_flat Product Flat Data
catalog_category_flat Category Flat Data
catalog_category_product Category Products
catalogsearch_fulltext Catalog Search Index
cataloginventory_stock Stock status

2 thoughts on “Reindex magento via Command Line

Comments are closed.