How to Re-Index your Magento Website using the Command Line?

Please fill this form, We'll reply within 24 Hrs.


Re Indexing in Magento 2

Magento has qualified to become one of the best possible eCommerce store models in the present times. You would find that when running an online store you would have hundreds of products lined up on your store. Each one has a different priority and each one is different from the other. While considering that, you need to figure out how to index the products such that they are available to the consumers based on their priority.

The best part of using Magento as a platform is that it indexes the products automatically. When you load products to your Magento based website, you will find that the indexing is done automatically, and the products are lined up easily as per their priority.

Recommended Read: How to Indexing in Magento using Command Line in terminal or Prompt?

But, what happens when your products are upgraded? What happens when you suddenly find newer products on your website? How will you begin indexing them? Before you perform the task of re-indexing you will need to identify a few this and begin understanding how the process works. You will also need to understand how the command line is used for the process too.

Status of Indexes

Before you begin reindexing of your products, you need to consider the exact status of your indexes. When you check the status, you will find that the output you receive as a result of this would be something like below:

Product Flat Data: Requires Re-Indexing

You will find those category products, category flat data etc. have an output which says pending. In this case, you may want to consider re-indexing of your data. You have two major ways to re-index the data. One you can re-index using a single index or using multiple indices. You have this choice.

Re-indexing a Single Index

When you begin indexing you will find that each index in the product catalog has its own indexing key. This key, you can use whenever your web store asks you to re-index your product catalog. This way you will be able to index your products easily and faster.

Whenever you wish to re-index a single product, you may want to use the following command.

Php indexer.php – reindex [Index Option Code]

In case you are planning to re-index multiple indices, here is your command

Php indexer.php – reindex catalog_product_price, catalog_url, catalog_product_flat

Re-indexing Everything

The other way to re-indexing is when you consider re-indexing all the possible indexes available on your website. Here is the command that may benefit you.

Php indexer.php – reindexall

Re-indexing using Command Line

When you are using a command line, you need to know what you are planning to re-index. Like the one explained above, checking on your index status is very important. For that you may need to use the following command line:

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

Now when you do that you will receive the information on the following indexes

  1. Product Attributes
  2. Product Prices
  3. URL Rewrites
  4. Product Flat Data
  5. Category Flat Data
  6. Category Products
  7. Catalog Search Index
  8. Stock Status.

Once you have the information on all these indexes, you can use a command line to allow you to re-index the data for any one of these product attributes related data.

The command used for the purpose includes:

Php/your-Magento-Path//shell/indexer.php –reindex catalog_product_price

OR

Php/your-Magento-Path//shell/indexer.php – reindex cataloginventory_stock

You will see that this method of re-indexing works to be faster as compared to other methods including changing the admin settings. In case you have upgraded the products on your website, it is a good habit to change the indexes too.

Need any help in website re-indexing or any Magento services? Feel free to talk with M-Connect’s Magento Developers.  We are happy to help you.

Magento Theme Development
Magento Mobile Applications

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Please fill this form, We'll reply within 24 Hrs.


Please fill this form, Mr.Yogesh will reply by email asap.


Please fill this form, Mr.Darshit will reply by email asap.


Please fill this form, Mr.Jayesh will reply by email asap.


Please fill this form, Mr.Jiten will reply by email asap.


Free eGuide

Ultimate Guide on Magento 2 Shipping Methods

Shipping Methods also play a very vital role in an eCommerce store, to make it a success.
DOWNLOAD NOW