1

Magento version: 2.3.1

When I run inventory reindex from command line it first runs inventory reindex and then price reindex after that.

Here is the command I executed:

bin/magento indexer:reindex inventory

Output on console:

Inventory index has been rebuilt successfully in 00:00:40
Product Price index has been rebuilt successfully in 00:08:10
Catalog Search index has been rebuilt successfully in 00:25:01

As you can see from console output, price and catalog search reindex also executed.

How can I prevent running price reindex automatically? I want just inventory reindex.

  • How do you run indexes? What commands? What sequence? – Dominic Xigen May 29 '19 at 17:32
  • @DominicXigen updated the command and output in question – Satish Gadhave May 30 '19 at 4:44
1

If you want to first runs inventory reindex and then price reindex after that.

You have to need run below command for individual selected indexer run.

php bin/magento indexer:reindex cataloginventory_stock

php bin/magento indexer:reindex catalog_product_price

| improve this answer | |
  • I have updated command and output in the question. Let me know if you can help. – Satish Gadhave May 30 '19 at 4:45
  • Yes let me know what is the issue after run above command step by step. – Kirti Nariya May 30 '19 at 4:47
  • Issue is, I'm running command to reindex only inventory but if you see the console output, its reindexing price and catalog search as well. I dont want price and catalog search to run after inventoy reindex. – Satish Gadhave May 30 '19 at 4:51
  • If you run cmd: php bin/magento indexer:reindex cataloginventory_stock then only execute Stock index. – Kirti Nariya May 30 '19 at 5:07
  • I tried that. It does not reindex price but Catalog Search reindex is still happening. Here is the output: bin/magento indexer:reindex cataloginventory_stock Stock index has been rebuilt successfully in 00:00:00 Catalog Search index has been rebuilt successfully in 00:00:01 – Satish Gadhave May 30 '19 at 5:27
1

Described behavior may seem to be completely unobvious, however it's expected.

The thing is, that indexers may depend on each other, like in your case, Catalog Search indexer depends on Price indexer, which, in turn depends on Inventory index. This chain might not be optimal, however all of them must run to ensure data consistency, as inventory availability may impact data in the price index and so on.

Indexer dependencies are configured via DI configuration, and I believe it's possible to override this config for your specific case. However, this is not something I would recommend, as it may impact data consistency and correct display of catalog information.

Looking at the initial question I assume that you are concerned about performance. Have you looked into reindex on save or reindexing at a time when store does not experience biggest customer flows? This kind of problem may be mitigated in different ways depending on your business scenario. Please let us know the details and might find a solution together.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.