Nexcess Logo

How to Issue a Reindex in Magento 2

Knowledge Base Home

Notice anything different?

We've enhanced the appearance of our portal and we're working on updating screenshots. Things might look different, but the functionality remains the same.
September 21, 2021

Image by magento.com

 

Magento 2 doesn’t necessarily have the lowest resource usage footprint, and with good reason. A standard Magento installation generates and stores a considerably high volume of data in the form of stores, catalogs, users, offers, etc. Here is where indexers come in handy.


Indexers are objects that create an index of all this data to help increase our storefront’s performance and response time, increasing conversion rates. Knowing that, our indexes must be up to date, always showing the most accurate information at any time.


In this post, we’ll be discussing the two methods to reindex in Magento 2: via the admin panel and through the command-line interface. 


How to Reindex Magento 2 Through the Admin Panel

Unlike Magento 1, it is not possible to manually issue a reindex for Magento 2 from the admin panel. Instead, the “Magento_Indexer” performs the tasks for us. We can still set the indexing mode, though. There are two options: “Update on Save” and “Update by Schedule.


The first option allows the indexer to reindex in real-time, as changes are being made in the admin panel. When we select “Update by Schedule,” it proceeds with the reindex at a specified time, with the help of a Magento cron job. To access the index management panel, we need to go to: 


System >> Index Management:

Once we are in the index management panel, we can select the indexing mode of our preference:

In some instances, our indexers will be invalidated:

In those cases, we need to reindex all the affected indexers manually, and this has to be done via the command-line interface, as we will show below. 

How to Reindex Magento 2 Via SSH 

As previously mentioned, when the indexers are invalid, or if we want to make sure all indexers are reindexed, it is convenient to issue a reindex via the command-line (SSH). 


The first step is to go to your Magento’s root directory (in this case, /home/coolmsite/public_html). Optionally, we can verify the status of the indexers using the indexer:status command:


LiquidWeb$ pwd

/home/coolmsite/public_html


LiquidWeb$ bin/magento indexer:status

As we can see, a reindex is required for all indexers. So the last step would be to issue the indexer:reindex command to reindex and fix that up:


LiquidWeb$  bin/magento indexer:reindex

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

Catalog Rule Product index has been rebuilt successfully in 00:00:00

Product EAV index has been rebuilt successfully in 00:00:00

The inventory index has been rebuilt successfully in 00:00:00

Catalog Product Rule index has been rebuilt successfully in 00:00:00

Stock index has been rebuilt successfully in 00:00:00

Product Price index has been rebuilt successfully in 00:00:00

Catalog Search index has been rebuilt successfully in 00:00:00

That is the expected output, and it was a success. We can verify running again the indexer:status command:



If we don’t need to reindex all the indexers, we can specify the indexers. In the following example, we will reindex the “Design Config Grid” index and the “Inventory” index:


LiquidWeb$  bin/magento indexer:reindex design_config_grid inventory

Design Config Grid index has been rebuilt successfully in 00:00:00

Inventory index has been rebuilt successfully in 00:00:00

Need More Help?

If you need additional help in this topic or any other related matter, reach out to us for 24-hour assistance any day of the year by email or through your Client Portal



Luke Cavanagh
Luke Cavanagh

Luke Cavanagh, Strategic Support & Accelerant at Liquid Web, brings a decade of experience working with WordPress and WooCommerce to our product team. His GitHub page offers a glimpse into his multiple areas of subject matter expertise.

"Ninja stuff with WordPress and WooCommerce," is an apropos way to describe Luke's savviness with these platforms — and his way of influencing our organization for improving to them.

Coming out of the University of Brighton with a Business and Technology Education Council (BTEC) Higher National Diploma (HND) in 2D & 3D Design, Luke's credentials prepared him well for his current role that blends both web development and design. His HND credential leveraged his foundational learning at West Kent College, where is received a National Diploma (ND) in Graphic Design.

In his personal life, Luke is a devoted husband and teen wrangler. He considers himself a Synthwave enthusiast, Jerry Goldsmith fan, and Doctor Who aficionado. He is happy to introduce his friends and teammates to essential vocabulary for life found only in British English, such as "gubbins" and similar terms.

We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.