Magento Themes and Magento Extensions

How To Run Magento Indexer From Command Line


magento themes club

By default Magento indexes most of its products, data etc. just to access it much faster when requested. Unfortunately, in some events when you update your products you are required to re-run the Magento indexer so new changes are reflecting in Magento’s index, and become visible on your store’s frontend.

There are two ways to run Magento indexer; You can either login to your store’s Admin Panel and go to System tab > Index Management. You will notice that those who required indexing are showing in Red as REINDEX REQUIRED and other indexed are showing in green as READY.

Running indexing from Admin Panel is straight forward and you can simply select all which require reindexing and click start and that’s it. But for those technical people who like command line to do most of the jobs here is how you can index your products.

Running Magento indexer From Command Line (Console)

Command to check the current status of all indices is:

php /your-magento-path/shell/indexer.php --status

php /your-magento-path/shell/indexer.php info

To refresh the specific index, you need to select a specific indices to index. This will return results like followings:

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

Now, to run indexer on any indices you have to run command like this

php /your-magento-path//shell/indexer.php --reindex catalog_product_price
php /your-magento-path//shell/indexer.php --reindex cataloginventory_stock

The command line approach is considered to be little bit faster than admin panel. So, what’s your favorite way of indexing Magento’s data? Please leave me a comment and let me know. Subscribe our RSS to receive latest updates on Magento development and Magento Howto’s.

Leave a Reply

You must be logged in to post a comment.