Magento2 indexes

First of all you need to change the directory to  shell folder under magento root


Checking for the status of all indexes

php bin/magento indexer:status

Re-indexing a single index
Each index has its own index key that you can use to reference it when asking Magento to re-index. To get these keys, you can use the following command:

php bin/magento indexer:info


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
catalogrule_rule                                 Catalog Rule Product
catalogrule_product                           Catalog Product Rule
cataloginventory_stock                      Stock
catalogsearch_fulltext                       Catalog Search


To reindex a single index, run the following command.

php bin/magento indexer:reindex [Index Option Code]

Re-index all indexes
The following code will loop through each index and re-index it.


php bin/magento indexer:reindex

php bin/magento indexer:reindex catalogrule_rule