How to Reindex in Magento 2 from Admin & CLI?
Magento 2 (Adobe Commerce) has a complex architecture for storing data in various tables. Reading these databases on each page load can be time-consuming–not ideal for optimum performance.
Indexing is a feature that speeds up this process. And sometimes, you may need to reindex Magento 2 to reflect new changes in data.
In this post, learn what Magento 2 Reindex is also how to reindex in Magento 2 using CLI command and admin.
What is Magento 2 Reindex?
Magento 2 Reindexing is the process of updating the index tables. Meaning it ensures that the latest data or changes in the core database are reflected on the frontend. It is an essential process for accuracy and optimum website performance.
Generally, Magento 2 automatically reindexes data regularly or on save changes action, based on how you configured it. But sometimes, you may need to perform a manual reindex.
In Magento 2 reindex is required for these 8 indexers when any changes are made:
- Category products
- Product categories
- Product price
- Product entity attribute value
- Stock
- Catalog rule product
- Catalog product rule
- Catalog search
How to Reindex in Magento 2 from Admin & CLI?
Magento 2 allows you to perform a manual reindexing from the admin panel. Or you can also use the Magento 2 Reindex commands to do that. Both methods are effective ways to reindex Magento 2 data.
Reindex Magento 2 From Admin Panel:
In the Magento 2 admin panel, you can set the indexers to update on schedule or save events. To reindex data in Magento 2, set the index update mode to Update by Schedule. Doing so will reindex the data during the following cron job.
Here are the steps on how to reindex Magento 2 from admin panel.
In the Magneto 2 admin, go to System > Index Management.
Now, the list of the indexers in Magento 2 will be displayed on the Index Management screen.
Select the indexers that you want to reindex and select Update by Schedule in the top-left drop-down menu.
Click Submit to save the changes.
Now, Magento 2 will reindex these indexers on the next cron job. (By default, the cron job runs every minute in Magento 2.)
Reindex Magento 2 From CLI:
The Magento 2 Reindex command allows you to reindex indexers from the command-line interface. Go to the root directory and run the following Magento 2 CLI reindex command:
php bin\magento indexer:reindex
You can replace the indexer
value with a space-separated list of indexers you want to reindex.
Or to Magento 2 reindex all indexers, you can simply run the command: php bin\magento indexer:reindex and you’ll get a status message like the one shown below.
That’s how you can reindex Magento 2 from the admin panel and CLI. Feel free to ask in the comments if you have any queries or doubts. I’d be happy to assist you.
Thanks for reading till the end. Please share this post with your developer friends on social media and online communities.
Need help with Magento platform? Hire our Adobe-certified experts.
Sanjay Jethva
Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe.
His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.
Prev
How to Install Magento 2 on Ubuntu: Step-by-step [2024]
How to Do Pre Orders on Shopify? [No App Required]
Next