How to reindex in Magento 2?

How to reindex in Magento 2

Magento 2 is indeed favored mostly for its complicated structure, system based on this platform carry lots of merchant’s data such as prices, users, catalog info, coupons, etc. All of them are both gathered and featured in many database tables. To optimize the display at the frontend, most essential information is stored within special tables using indexers that collecting the data.  When making any data changes, the transformed data must be updated, or in other words, reindexed. With the support of reindexing, Magento 2 website admin can quickly and correctly change the store data, reduce the waiting time of customers, and increase the conversion rate.

So, in this article, we want to introduce two main methods to reindex in Magento 2.

Method 1: Reindex in Magento 2 via the command line

The first method that we would like to mention is reindexing in Magento 2 via the command line. This method is applied when you need to issue reindexing data instantly. Here is what you need to do:

  • Step 1: Log in to your store via SSH/CLI 
  • Step 2: Navigate your root directory of your store
  • Step 3: Run the following command: php bin/magento indexer:reindex

This will result in the following log:

reindex in Magento 2_1

  • Step 4: Check the status of the indexers and identify indexers that still need to be individually reindexed by the following command: php bin/magento indexer:status

This should show the result:

reindex in Magento 2_2

  • Step 5: Show the list of the indexers and the corresponding indexers by running this command: php bin/magento indexer:info and we will get this result:

reindex in Magento 2_3

  • Step 6: Reindex each indexer that has status “Reindex required” using this command: php bin/magento indexer:reindex [catalog_category_flat]

For example: php bin/magento indexer:reindex catalogrule_rule

  • Step 7: Check again, using the command from step 4. Indexers should be “Ready” as below:

reindex in Magento 2_4

Method 2: Reindex in Magento 2 from admin panel

Another great way to reindex in Magento 2 is that you can reindex via Magento 2 Admin. Here’s what you need to do:

  • Step 1: From the Admin panel, go to SYSTEM > Index Management. To the right, the Index Management grid is shown, so you can check indexers status.

reindex in Magento 2_5

  • Step 2:  Select indexers, which has status Reindex Required, then go to Actions > Update on schedule. This will automatically trigger a reindex for selected indexers.
  • Step 3: Press Submit button to apply selected mode to indexers.

Quick, easy and effective, these 2 methods on how to reindex in Magento 2 is just for you! Each method has its own pros and cons, but whether using the 1st or 2nd method, the result will definitely bring the best satisfaction to you!


⇒ You may also like:

1843 Total Views 77 Views Today