Skip to content

Commit 1775766

Browse files
Move catalog search indexer outside stores loop
1 parent 32fda1c commit 1775766

File tree

1 file changed

+7
-4
lines changed
  • app/code/Magento/Elasticsearch/Model/Indexer/Fulltext/Plugin/Category/Product/Action

1 file changed

+7
-4
lines changed

app/code/Magento/Elasticsearch/Model/Indexer/Fulltext/Plugin/Category/Product/Action/Rows.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,15 @@ public function afterExecute(
7777
): ActionRows {
7878
$indexer = $this->indexerRegistry->get(FulltextIndexer::INDEXER_ID);
7979
if (!empty($entityIds) && $indexer->isScheduled()) {
80+
$productIds = [];
81+
8082
foreach ($this->storeManager->getStores() as $store) {
8183
$indexTable = $this->getIndexTable((int) $store->getId(), $useTempTable);
82-
$productIds = $this->getProductIdsFromIndex($indexTable, $entityIds);
83-
if (!empty($productIds)) {
84-
$indexer->reindexList($productIds);
85-
}
84+
$productIds = array_merge($productIds, $this->getProductIdsFromIndex($indexTable, $entityIds));
85+
}
86+
87+
if (!empty($productIds)) {
88+
$indexer->reindexList(array_unique($productIds));
8689
}
8790
}
8891

0 commit comments

Comments
 (0)