How to Reindex in Magento 2 - CLI / Backend
Index is how Magento re-constructs these data to optimize the performance of the storefront. Magento is built on a sophisticated architecture which stores merchant data such as prices, users, catalog data in different database tables. When the data changes, the transformed data must be updated or reindexed. With the support of reindexing, Magento 2 store owners can quickly and correctly change the store data, reduce the waiting time of customers, and increase the conversion rate.
In this article, I will show you two methods to reindex in Magento 2: via command line, or in the backend using Mavenbird extension. While the first method can be done by using code, if you are not sure about your coding skills, scroll down to see the quick and ultimate solution from us.
How to Reindex in Magento 2
Method 1: Reindex data via the command line
The first method is using the command line to reindex data. Initially, let’s me show you reindex commands in Magento 2.
indexer indexer:info Shows allowed Indexers indexer:reindex Reindexes Data indexer:reset Resets indexer status to invalid indexer:set-mode Sets index mode type indexer:show-mode Shows Index Mode indexer:status Shows status of Indexer
How to Run Reindex Command Line
Now, I will instruct you to run the reindex command line with ease. After going to Magento root folder, run the following:
php bin/magento indexer:reindexResult:
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:00:00 Product Price index has been rebuilt successfully in 00:00:00 Product EAV index has been rebuilt successfully in 00:00:01 Catalog Search index has been rebuilt successfully in 00:00:01 Stock index has been rebuilt successfully in 00:00:00 Catalog Rule Product index has been rebuilt successfully in 00:00:00 Catalog Product Rule index has been rebuilt successfully in 00:00:00
Check indexer status by the following command
php bin/magento indexer:infoWe will get result:
design_config_grid Design Config Grid customer_grid Customer Grid catalog_category_product Category Products catalog_product_category Product Categories catalog_product_price Product Price catalog_product_attribute Product EAV catalogsearch_fulltext Catalog Search cataloginventory_stock Stock catalogrule_rule Catalog Rule Product catalogrule_product Catalog Product Rule
How to Reset indexer status to invalid
php bin/magento indexer:resetHow to Show Index Mode
php bin/magento indexer:show-modeResult:
$ php bin/magento indexer:show-mode Design Config Grid: Update on Save Customer Grid: Update on Save Category Products: Update on Save Product Categories: Update on Save Product Price: Update on Save Product EAV: Update on Save Catalog Search: Update on Save Stock: Update on Save Catalog Rule Product: Update on Save Catalog Product Rule: Update on Save
How to Set index mode type
php bin/magento indexer:set-mode {realtime|schedule} [indexer]E.g:
magento indexer:set-mode schedule catalog_category_product catalog_product_categoryMethod 2: Reindex data from Admin panel with Magento 2 Backend Reindex
In this part, I will give you another choice to reindex data easily with the support of Mavenbird Backend Reindex extension which allows store admins to reindex data from the admin backend without the help of developers.
The problems arising from Reindex in Magento Default
In Magento 2 Default, once the store database has any changes, the data must be reindexed by using Command line or setting up a cron job. However, not all store admins have enough coding knowledge so they may be confusing and make mistakes during the reindexing process. Also, it is time-consuming and affects to the storefront negatively .
The solutions with Mavenbird Backend Reindex
Mavenbird Backend Reindex comes up with great solutions to make the reindexing process simpler and quicker. With the help of this extension, store admins can easily reindex data manually from the admin backend anytime without the help of developers. In case that all the store data changes, any store admins are allowed reindex all data just via one click. The massive data of Magento website can run smoothly when there are any updates.
The configuration of Mavenbird Backend Reindex
From the Admin panel, go to SYSTEM > Index Management. To the right, the Index Management grid is shown, as below:
- Reindex one indexer
In the Actions column on the right of the screen, click on the Reindex Data button to reindex each indexer.
- Reindex some indexers
To reindex more than one indexer, click to select the indexers you need to reindex. Then, choose the Reindex Data on the Action box and click the Submit button.
- Reindex all the indexers
In the Mass Action box on the top left corner of the grid, click to choose the Select All option. Then, click the Submit button. Alright, with just simple steps, all your store databases are now updated, ready and bright.
What can Mavenbird Backend Reindex help your store?
- Allow you to set up reindex without any coding, so it is easy to execute for all admins
- One-click action to mass update saves time and effort, which enhances user experience
- Reindex notifications show the updates process timely and clearly for better result tracking
- Restrict Admin roles in reindex access help protects your store data
Conclusion
Above is the detailed instruction of reindexing data with or without the command line. Instead of the complicated reindexing process using coding, Mavenbird Backend Reindex supports online store admins to complete this challenging task right at the admin panel. Hence, they can manage their store more effectively, improve storefront, bring satisfaction to their customers and lift the store sale.
If you have any questions, don’t hesitate to contact us.