Description
This issue is automatically created based on existing pull request: #33227: Move catalog search indexer outside stores loop
Description (*)
There's a plugin (catalogsearchFulltextProductAssignment / Magento\Elasticsearch\Model\Indexer\Fulltext\Plugin\Category\Product\Action\Rows) in the Magento Elastisearch module that hooks in on the Category Products indexer (Magento\Catalog\Model\Indexer\Category\Product\Action\Rows)
This plugin receives the category id's that are reindexed by the Category Products indexer. This plugin collects the assigned products from these categorie id's per store. And inside this loop it triggers a Catalog Search Fulltext reindex for these product id's.
The problem is that the indexer is executed within the stores loop. But the indexer itself already does a reindex for all stores.
We ran in to this issue with our setup that contains 12 stores. 1 category was passed in to the Category Products indexer. The plugin was executed after fetches all connected products for this category (1000+). These 1000 were reindexed in the 12 stores loop and indexed 12 times in each loop.
Manual testing scenarios (*)
- Have a Magento setup with a lot of stores
- Have a category with a lot of products
- Disable the category, save it, enable the category, save it.
- Check how long the indexer Category Products takes
Contribution checklist (*)
- Pull request has a meaningful description of its purpose
- All commits are accompanied by meaningful commit messages
- All new or changed code is covered with unit/integration tests (if applicable)
- README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- All automated tests passed successfully (all builds are green)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status