a. Reindex from Magento admin *sometimes not all indexers are reindexed using admin reindex > check also reindex via SSH
1. Go to System > Index Management and check indexers status.
2. Select the items that are marked as "Reindex required" and go to Actions > Update on schedule
This will trigger a reindex for selected indexers.
Important: Sometimes not all indexers are reindexed using admin reindex even if time & date is showing as updated in magento admin. We recommend to double check the reindex process using the SSH/CLI reindex method presented below.
Reindex mode: You can set your indexers as "Update on Save" and store entities will be indexed when saving admin configurations or as "Update by Schedule" and indexers will be reindexed recurrently (default once / day) . In order for "Update by Schedule" to work ok, make sure your cron jobs are running correctly on your server. Your hosting partner or development team can help you with the cron jobs configuration. If you are using the WeltPixel Magento 2 Pearl Theme or any other WeltPixel Magento 2 extension, an easy way to verify that your cron jobs are running correctly is to head into the dedicated Developer Section that we've included, which provides not only valuable information about your crons, but also about the server in general, such as:
Magento Mode: Production, Developer or Default, Magento Installation Path, Magento Edition, PHP Version installed on the server, Server User, Current Date and Time, Latest Cron Jobs.
b. Reindex via SSH / CLI (recommended)
1. Connect to your Magento 2 installation in the root of your project. (usually in public_html or under yourmagentoinstallation.com/html)
2. Reindex all Magento 2 indexers using below command:
php bin/magento indexer:reindex
You will receive a similar result as presented below:
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
Product Price index has been rebuilt successfully in 00:00:01
Product EAV index has been rebuilt successfully in 00:00:01
Catalog Search index has been rebuilt successfully in 00:00:01
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:01
Catalog Product Rule index has been rebuilt successfully in 00:00:00
3. Check the status of the indexers and identify indexers that still need to be individually reindexed, sometimes general reindex does not work for all indexers
php bin/magento indexer:status
You will receive a similar result as presented below:
Design Config Grid: Ready
Customer Grid: Ready
Category Products: Ready
Product Categories: Ready
Product Price: Ready
Product EAV: Ready
Catalog Search: Ready
Stock: Ready
Catalog Rule Product: Reindex required
Catalog Product Rule: Ready
4. Show the list of the indexers and corresponding indexer id that need to be used for individual reindex.
php bin/magento indexer:info
You will receive a similar result as presented below:
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
5. Reindex each indexer that has status "Reindex required" using below commands:
php bin/magento indexer:reindex [catalog_category_flat]
Example: php bin/magento indexer:reindex catalogrule_rule
php bin/magento indexer:reindex design_config_grid customer_grid
php bin/magento indexer:reindex catalog_category_product
php bin/magento indexer:reindex catalog_product_category
php bin/magento indexer:reindex catalog_product_price
php bin/magento indexer:reindex catalog_product_attribute
php bin/magento indexer:reindex catalogsearch_fulltext
php bin/magento indexer:reindex cataloginventory_stock
php bin/magento indexer:reindex catalogrule_rule
php bin/magento indexer:reindex catalogrule_product
6. Check again the status of the indexers using the command from step 2, now all indexers should be "Ready".
Done!
Comments
2 comments
Hello,
I have upgraded my magento version from 2.1.0 to 2.1.7
Earlier the reindex time for Product Categories was 00:03:08 and now it has increased to 01:12:00
Can anyone help me understand the reason behind this?
Hi,
Normally the upgrade should not justify the highly increased reindex time. Are you able to replicate this again? If you are using a shared server, maybe your server experienced a temporary high load while running the reindex that affected the server performance?
Please sign in to leave a comment.