Magento1 indexes

First of all you need to change the directory to  shell folder under magento root

{Magento root}/shell

 

Checking for the status of all indexes

php indexer.php --status


Re-indexing a single index
Each index has its own index key that you can use to reference it when asking Magento to re-index. To get these keys, you can use the following command:

php indexer.php --info

 

  • catalog_product_attribute     Product Attributes
  • catalog_product_price         Product Prices
  • cataloginventory_stock        Stock Status
  • 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

To reindex a single index, run the following command.

php indexer.php --reindex [Index Option Code]


This can be comma delimited for multiple indices:

php indexer.php --reindex catalog_product_price,catalog_url,catalog_product_flat


Re-index all indexes
The following code will loop through each index and re-index it.

php indexer.php --reindexall

php indexer.php --reindex catalog_url