What is Magento 2 index
Magento is favored for its sophisticated architecture, systems based on this platform carry a lot of merchant’s data. For example, catalog info, product prices, sales prices, coupons,etc., all both gather and are distributed in many database tables. To optimize the display at frontend, most essential information is stored within special tables using indexers that collecting the data. In many cases, as consequences, a Magento website admin should keep the indexes up-to-date to present actual data on the storefront. Thus, in this article, we will deliver a quick guide on how to reindex in Magento 2.
When to reindex data in Magento 2
In Magento 2, there are eight indexers that reindex is required, when any changes are made.
- Category products;
- Product categories;
- Product price;
- Product entity attribute value;
- Catalog rule product;
- Catalog product rule;
- Catalog search.
For example, when adjusting a product price, the data should be reindexed to be correctly displayed on the frontend. So, “reindex the indexation” would adequately reduce time spent on calculating a final order price including cart price rules, bundle pricing, discounts, tier pricing, etc.
In older Magento versions, indexation is dependent on the indexer.php file placed under the shell folder. In Magento 2 it’s managed by the bin/magento instead.
How to reindex in Magento 2
There are two methods to reindex data in Magento 2.
Reindex data using the command line
The first method is to reindex Magento 2 via the command line. If you are not on a shared hosting server then it’s likely that you’d be given a SHELL access. You should do the following to update index via Magento CLI.
- Log in to your Magento Shell
- Go to your Magento root directory
- Run the following: PHP bin/Magento indexer:reindex
Reindex data from admin panel
Next, another choice for the admin is from Admin Panel. Admin can go to Index Management under System, then select the options. Once selected, change the Index method from “Update on Schedule” to “Update on Save”. Update on save will update indexes whenever you complete an action in Magento which requires index update.
Trigger Magento 2 reindexing with Reindex from Backend for Magento 2 extension
While the technique to reindex data in Magento 2 via command line is quite time-consuming. On the other hand, the two options to reindex in default Magento 2 admin panel (update on save and update on schedule) show some drawbacks. For instance, “update on save” mode will fire some (indexing related) events after a product is saved. So, a full reindex won’t be necessary after product updates. Meanwhile, “update on schedule” mode won’t fire anything, but you’ll need to reindex everything in order to see some changes in the frontend
Reindex from Backend for Magento 2 extension would be an effective tool. In Index Management at the backend, after choosing the indexers, Reindex Data is now available in Actions box for admin to choose.
Just a click on Submit and all your data is now ready, clean and bright.
After reindexing is finished, an announcement will be displayed to confirm again about the process.
This extension could optimize the reindex command in Magento 2. Instead of using CLI, admin now can configure on the admin panel. At the same time, all admins understand that reindexing helps the massive data of Magento run smoothly when changes are made. Hence, we genuinely hope that this FREE Magento 2 module can be a supportive tool for any store owner.
Here is what we think you should know about how to reindex in Magento 2. In case you have any further question regarding this blog, Website Development or our extension store on Magento 1 and Magento 2, please feel free to contact us. Our support team is always willing to aid you with the best service of FREE installation, FREE update, FREE 1-year support and 30-day money back guarantee.