Tuesday, February 17, 2015

Re-Index Data With Command Shell

Magento uses a lot of resources to re-index data from the Admin Panel. A good way to re-index data without using the admin panel is to use command shell “ssh”. This also would work if you happen to be locked out of the admin panel.



Here is instruction on how to use default Magento indexer via SSH:

1 – Go to ‘shell’ folder in your Magento installation:

cd shell                                           

2 – Execute reindex using this command:

php -f indexer.php reindexall                      

It is possible to get full list of Magento indexer commands using this command:

php -f indexer.php help                            

To get a list of available indexes, execute this command:
 
php -f indexer.php info                            
 

By default there are 8 indexes in Magento:

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         

Individual commands for re-indexing:

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              
 

No comments:

Post a Comment