Magento can just easily be indexed via backend by going to System – Index Management section but sometimes this process can fail or the backend might not be accessible. A simple way to bypass this is to log in using command line and the following:
Navigate to the root of your Magento installation. Once there, run the following command for reindexing all :
php ./shell/indexer.php -reindexall
You should see something like this:
Or each of the following for individual indexing:
php ./shell/indexer.php -reindex catalog_product_attribute
php ./shell/indexer.php -reindex catalogsearch_fulltext
php ./shell/indexer.php -reindex catalog_category_flat
php ./shell/indexer.php -reindex cataloginventory_stock
php ./shell/indexer.php -reindex catalog_category_product
php ./shell/indexer.php -reindex catalog_product_flat
php ./shell/indexer.php -reindex catalog_product_price
php ./shell/indexer.php -reindex tag_summary
php ./shell/indexer.php -reindex catalog_url
A help screen is accessible by typing:
php ./shell/indexer.php -help