Reindex means that the index tables in the database are updated and rebuilt. Is it important? These index tables have a direct relation with various front-end operations, including search functionality and product listings. A lack of frequent updates and rebuilding can undermine the customer experience, thereby leading to poor sales.
Whenever data changes in Magento 2, there is a need to update the corresponding tables in the database. However, Magento does not update the tables immediately. Instead, what it does is that it queues all these updates for later. You might be wonder why doesn’t it update immediately?
Since data such as product listings or customer information is continuously changing, frequent updates can undermine the system’s performance. Suppose this happens at a time when your online store is experiencing peak traffic. With poor performance, even your loyal customers won’t have issues shifting to another store.
When the data is not reindexed after an update, an incorrect data is displayed on the frontend and a lot more slowly. Indexing consolidates the data and speeds up the pitching process. Let’s take an example to understand this point better. Suppose you recently updated the prices for a few top selling products.
However, you did not do reindexing. When customers add the product to their cart, it will either display the old prices or the page will take longer than usual to load. In either case, the customer experience is quite poor. The most likely outcome is cart abandonment and poor word of mouth.
In this tutorial, we're going to show you two methods that actually work to reindex Magento 2. You can reindex Magento 2 from the backend Admin Panel and also via SSH/ Command Line (CLI) method.
The command line reindexes one time only. To reindex all or selected indexers using this method, connect to your Magento 2 root directory from command line.
bin/magento indexer:reindex [indexer]
Design Config Grid index has been rebuilt successfully in 00:00:00 Customer Grid index has been rebuilt successfully in 00:00:00 Category Products index has been rebuilt successfully in 00.00.00 Product Categories index has been rebuilt successfully in 00.0.00 Catalog Rule Product index has been rebuilt successfully in 00.00.01 Product EAV index has been rebuilt successfully in 00.00.01 Inventory index has been rebuilt successfully in 00.00.01 Catalog Product Rule index has been rebuilt successfully in 00.00.00 Stock index has been rebuilt successfully in 00.00.01 Product Price index has been rebuilt successfully in 00.00.01 Catalog Search index has been rebuilt successfully in 00.00.00
bin/magento indexer:info
design_config_grid | Design Config Grid |
customer_grid | Customer Grid |
catalog_category_product | Category Products |
catalog_product_category | Product Categories |
catalogrule_rule | Catalog Rule Product |
catalog_product_attribute | Product EAV |
cataloginventory_stock | Stock |
catalog_product_price | Product Price |
catalogrule_product | Catalog Product Rule |
catalogsearch_fulltext | Catalog Search |
bin/magento indexer:status
Design Config Grid: | Ready |
Customer Grid | Reindex required |
Category Products: | Ready |
Product Categories: | Ready |
Catalog Rule Product: | Ready |
Product EAV: | Ready |
Stock: | Ready |
Product Price: | Ready |
Catalog Product Rule: | Ready |
Catalog Search: | Ready |
php bin/magento indexer:reindex customer_grid
php bin/magento indexer:reindexNow all indexers should be "Ready".
If your data is not indexed properly, you might get the following error:
One or more indexers are invalid. Make sure your Magento cron job is running.
In this case, you need to Reindex Magento 2 via CLI.
Open the Comman Line and go to the Magento 2 root folder, then run the following command:
php bin/magento indexer:reindex
This concludes our article on how to reindex in Magento 2. If you have any issue in Reindexing Magento 2 from Admin, you can contact our support team by submitting a ticket here.
It refers to the process of updating and rebuilding index tables in the database. The purpose is to reflect the latest changes.
If you don’t reindex, latest changes won’t reflect on the store. Your customers will browse incorrect information and contend with poor store performance (e.g. slow loading times). It will undermine your store’s performance and brand image.
Once the reindexing process is complete, a message saying, “The stock index has been rebuilt successfully" will show up on the screen.
You should reindex whenever you make significant changes to your store, including product and customer information.
There is no specific time as various factors like store size, data complexity, and changes made need to be considered.
This blog was created with FME's SEO-friendly blog