Skip to content

Commit 59ee3e6

Browse files
authored
Move catalog search indexer outside stores loop
Apply suggestions from code review
1 parent 1775766 commit 59ee3e6

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ public function afterExecute(
8181

8282
foreach ($this->storeManager->getStores() as $store) {
8383
$indexTable = $this->getIndexTable((int) $store->getId(), $useTempTable);
84-
$productIds = array_merge($productIds, $this->getProductIdsFromIndex($indexTable, $entityIds));
84+
$productIds[] = $this->getProductIdsFromIndex($indexTable, $entityIds);
8585
}
8686

87+
$productIds = array_merge([], ...$productIds);
8788
if (!empty($productIds)) {
8889
$indexer->reindexList(array_unique($productIds));
8990
}

0 commit comments

Comments
 (0)