Aug 6, 2013

Magento: How to reindex via ssh or in terminal/console

Since reindexing request long term of running in our webserver. I thing it is better to do this one the console, to liminated the posoble timeout error.


Below are some possible command you can use.
Index product attributes for layered navigation building
php shell/indexer.php -reindex catalog_product_attribute

Rebuild Catalog product fulltext search index
php shell/indexer.php -reindex catalogsearch_fulltext

Reorganize EAV product structure to flat structure
php shell/indexer.php -reindex catalog_category_flat

Index Product Stock Status
php shell/indexer.php -reindex cataloginventory_stock

Indexed category/products association
php shell/indexer.php -reindex catalog_category_product

Index product prices
php shell/indexer.php -reindex catalog_product_price

Rebuild Tag aggregation data
php shell/indexer.php -reindex tag_summary


Index product and categories URL rewrites
php shell/indexer.php -reindex catalog_url

If you want to reindex all.
php shell/indexer.php -reindexall


Also, for other useful command parameter you can use help screen that is accessable via SSH using the command:
php ./shell/indexer.php -help

No comments: