Facing the same issue right now with version 2.2.1. There is a fix for 2.1.8 that makes the indexer quite faster in this github issue #10531.
Yet to try this on 2.2.1, I'll update you once I try it out. Note that the issue is closed but does not seem to be fixed. I just now finished indexing the catalog_product_price index and it took an insane 43h57m for ~350K products.
As mentioned in the previous link by @ashuston, you can change the return value to false
for the method isRangingNeeded()
in the Catalog/Model/Indexer/Category/Product/AbstractAction
class. That should make the indexing process faster but still pretty long.
Now, to answer your question, here are the steps to run the indexers :
php ./bin/magento indexer:status
- will tell you what indexers need to be ran
php ./bin/magento indexer:info
- find the names of the indexers (catalog_product_category)
php ./bin/magento indexer:reindex name_of_the_index
- will run only the specified index. If no index name is specified it will reindex all (might take a while...)
So far this is the only way to manually run indexers on Magento 2. The other way consists of creating cron jobs and running them on a schedule.