Magento 2

How to reindex Magento 2 through the terminal

February 14, 2022

How to reindex Magento 2 through the terminal

In this article we will learn how to reindex Magento 2 through the terminal, and also several actions on reindex such as: checking the status and also what it is for.

reindex Magento 2 through the terminal cover

Hey you programmer, ok? Let’s learn how to do reindex in Magento 2.

First let’s understand why we need to reindex in Magento and then how to reindex through the terminal

Indexing is a way that Magento transforms data such as: products and categories to improve store performance

These transformed data are saved in tables, so there is a need to re-index them, we can say that it is very similar to the cache

For example: we change the price of a product, in addition to clearing the cache we must re-index Magento to persist the correct data for customers

So now that we’ve seen the importance of reindex, let’s see which command runs it:

php bin/magento indexer:reindex

Using this command you will re-index all data that is saved in the table

Also, we can check the status of the reindex, to see if any need to be done, with this command:

php bin/magento indexer:status

We can also re-index individually, for less performance damage.

For this we need to know the identifier of each index, with the command:

php bin/magento indexer:info

Then to re-index an item individually, let’s say it’s the catalogrule_rule, we use the command:

php bin/magento indexer:reindex catalogrule_rule

Conclusion

In this article we learned why to do reindex and how to reindex Magento 2 through the terminal

Also, some other very useful commands dealing with the subject of reindex

As individual re-indexing, so as not to affect the performance of the virtual store so much

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x