2

I'm working on a Magento2 with 100's of websites in a multi-store setup. We're presently not using the asynchronous indexing feature, but rather re-index in full once per day. The whole reindexing process takes about 1 hour.

It appears that Magento processes each store in sequence by store_id. That means, a store with a high id - e.g. 765 - will not get re-indexed until all the other ones are fully processed. This repeats for each individual indexer.

I would like to affect that sequence so that certain stores - let's say the most active ones - get processed first.

Pretty sure, I'm going to need to write a module for this, but I'm looking for help with where to tap into the execution chain to override the default behavior.

1 Answer 1

0

A quick win for you is to write an after plugin to the function \Magento\Store\Model\StoreManager::getStores: in this function, just reorganise the stores with your important stores being sorted first.

I had other ideas but this is by far the least intrusive and most likely fastest to implement.

2
  • Yes, that might be a good first step. Thank you for that suggestion. Would love to hear more ideas if you have the time to share. Easy and quick is not a requirement for me in this case. Commented Sep 21, 2020 at 18:21
  • I understand this. I will add details on how I came to this solution. Although it sounds superfluous, I still believe it may well work and be the best solution. Commented Sep 21, 2020 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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