How to reindex data using Command Line in Magento 2

0

When working with Magento 2, sometimes you will need to reindex to avoid this system message: One or more indexer are invalid. Make sure your Magento cron job is runningreindex in magento 2

What we should do now is reindex the invalid indexers. In Magento 2, we are able to run the indexing using Command Line.

Show list of available indexers

In Magento 2 root directory, use the command to get the information:

Reindex all available indexers

In order to do the whole index management process, we have to run the following commands from Magento 2 root directory, use the command:

Or in the root/bin directory, use the command:

Check status of indexer

You can check status of indexer using the following command:

To check status of a single indexer, execute this command

Single re-indexing

In order to run single re-indexing command, use the command:

The indexer name is the one that we received from the previous command.

That comes to the end of the tutorial. Hope that your re-indexing process work perfectly. If you have any further contribution, please leave us with your comments.

Rate this post

Share.

About Author

Daniel is a Magento developer with 5 years of experience with customizing Magento extensions, Magento templates. He's main author at Magento explorer

Leave A Reply