How to process Magento indexes from the command line

July 5, 2016 Written By Yogesh Trivedi

Talk to Experts Need expert help? Don’t hesitate to talk.

You can do direct email atinfo@mconnectmedia.com

WE'RE HERE FOR YOU

We would love to hear about your Magento project, challenge, or opportunity. We'll respond within 24 hours!

Indexing is an extremely important process when it comes to the eCommerce store. If a store owner has updated something on the store or even added a new product, but the indexing was not performed after the update, 

then it will not be visible on the storefront. However, to keep the webstore up-to-date, store owners have to perform the indexing on a daily basis. So, if you are unaware about this index management till now, then it is time to get to know it.

Magento 2 is the latest eCommerce platform and the store based on this version should also know the indexing process. But the great thing about Magento 2 already has this impressive system built in it. When you make any change from the admin panel, the system automatically saves the changes and updates the system.

An Introduction to Magento 2.0 Index Management

As mentioned above, Magento 2.0 already has this feature in its system and it updates all the changes made, by its own. You must be thinking which are the changes that can is reindexed by this Magento 2.0 Index system. The changes may include anything starting from adding a new category, new products, new catalog, changes in the cost and similarly other data.

The next question which arises is that whether you will be able to access your store or admin panel while the indexing is going on? The answer to this question is simply Yes. You will be able to perform other tasks while the Index Management System will be doing his work. This is because the tool can perform its task from the background without interfering with the other tasks.

Magento 2 is complex for the beginner but not so hard for the expert. And one of the example of its complexity is how to re index Magento 2 as in admin panel it’s just allow you perform just couple of Action

  1. Update on Save
  2. Update by schedule via CRON job.

But the question: Unlike Magento 1 it’s not allowing for manual re index. Also it’s an obstacle especially when you are working on localhost or on dev site where you don’t have any cron job.

Indexing is important part of Magento 2 where you need this to be in action when you update, add or delete any records related to category, products updates. If you have schedule job activated then it will run automatically on any action performed for catalog.

Here is how it work via command line

In order to run any commands on Magento you need to get into the Magento CLI standard.

Go to root directory of Magento from terminal (Linux, mac) or command prompt on windows

You can also run the commands in the following ways to get into the magento command line access:

cd <your Magento install dir>/bin and run them as ./magento <command name>
php <your Magento install dir>/bin/magento <command name>
<your Magento install dir> is a subdirectory of your web server’s docroot.

For Linux

cd magento root/bin
magento indexer:reindex

For windows
On windows machine using command prompt you need to run command using php installed or using php.exe path, here is how it will go:

cd magento root/bin
php magento indexer:reindex

Now lets got into more details for indexer in Magento 2 with terminal:

  1. Get list of available indexer in Magento 2

Linux

magento indexer:info

Windows

php magento indexr:info

Above command will get you following available indexer with Magento 2.1

design_config_grid                            Design Config Grid

customer_grid                                   Customer Grid

catalog_category_product               Category Products

catalog_product_category               Product Categories

catalog_product_price                     Product Price

catalog_product_attribute              Product EAV

catalogsearch_fulltext                     Catalog Search

cataloginventory_stock                   Stock

catalogrule_rule                              Catalog Rule Product

catalogrule_product                        Catalog Product Rule

  1. How to check status of indexer

Following command will get you the status of all the indexer whether indexing is required or ready.

Linux

magento indexer:status

Windows

php magento indexer:status

Here is how it will display results based on the current status of indexing

Design Config Grid:                               Ready

Customer Grid:                                     Ready

Category Products:                              Reindex required

Product Categories:                             Reindex required

Product Price:                                      Reindex required

Product EAV:                                       Reindex required

Catalog Search:                                    Reindex required

Stock:                                                    Reindex required

Catalog Rule Product:                         Reindex required

Catalog Product Rule:                         Reindex required

You can also check status of individual indexer: let say i want to check status of catalog_category_product

Linux

magento indexer:status catalog_category_product

Windows

php magento indexer:status catalog_category_product

Here is the result from above command.

Category Products:                         Reindex required

  1. How to re index all the indexing.

Linux:

magento indexer:reindex

Windows:

php magento indexer:reindex

Here is the results with time:

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

Customer Grid index has been rebuilt successfully in 00:00:04

Category Products index has been rebuilt successfully in 00:00:04

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

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

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

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

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

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

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

This was all about the Magento 2.0 Index System and how it works in your Magento 2.0 store. But, let me just add one last thing in this. It may be possible that your store is managed by multiple admins. In this case, you can make a setting in the system to make the indexer perform the corn jobs and prevent the system from any misfortunes. The Index Management system has become a crucial part of the Magento eCommerce. However, I would highly recommend the learning of this process and tool along with others. To know more about our Magento 2.0 services, talk to our Magento Experts .

Need Magento expert help?

We provide result-driven solutions to expand the competency level and productivity.

Instant Help CenterAvailable!

Monday to FridayResponse promised within 24 hours!

Call Us

+1 319 804-8627

4 comments

  1. I always wondered how the indexing process works in eCommerce system. And with the new version of Magento, it seems more complex to me. But, you have explained everything very clearly and in a simple way. Apart from the coding thing, I understood all the information you shared. Thanks for this detail!

Load Comments

Your email address will not be published. Required fields are marked *

5 4 3 2 1

  • Worried for deadlines? Our Magento Experts are effortlessly Working from Home.
  • Check out our Magento Developer Hiring Packages for Agency as well as individuals.
View Packages

Talk to Experts Need expert help? Don’t hesitate to talk.

You can do direct email atinfo@mconnectmedia.com

WE'RE HERE FOR YOU

We would love to hear about your Magento project, challenge, or opportunity. We'll respond within 24 hours!

Please fill this form, Mr.Yogesh will reply by email asap.


Please fill this form, Mr.Darshit will reply by email asap.


Please fill this form, Mr.Jayesh will reply by email asap.


Please fill this form, Mr.Jiten will reply by email asap.