Skip to content

Commit 8acb919

Browse files
committed
6775 Fixes and improvements about slicing functionality
1 parent d2c93d6 commit 8acb919

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Solr/Indexer/ProductIndexer.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,18 @@ public function reindex($productIds = null, $emptyIndex = false, $restrictToStor
133133
}
134134

135135
if ($productIds == null) {
136-
$productIds = $this->productRepository->getAllProductIds($sliceId, $totalNumberSlices);
136+
$productIdsToIndex = $this->productRepository->getAllProductIds($sliceId, $totalNumberSlices);
137+
} else {
138+
$productIdsToIndex = $productIds;
137139
}
138140

139-
$associations = $this->productRepository->getProductAssociations($productIds);
141+
$associations = $this->productRepository->getProductAssociations($productIdsToIndex);
140142
$chunks = ProductIdChunks::withAssociationsTogether(
141-
$productIds,
143+
$productIdsToIndex,
142144
$associations,
143145
$pageSize);
144146
$productIterator = $this->productRepository->getProductsInChunks($storeId, $chunks);
145-
$this->_indexProductCollection($emptyIndex, $productIterator, $storeId, $productIds, $associations);
147+
$this->_indexProductCollection($emptyIndex, $productIterator, $storeId, $productIdsToIndex, $associations);
146148

147149
$this->deactivateSwapCore();
148150
} catch (\Exception $e) {

0 commit comments

Comments
 (0)