Skip to content

Commit 687f189

Browse files
committed
ACP2E-1569: Elasticsearch Indexer document version changes version when new/existing products are imported
1 parent c82c795 commit 687f189

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,6 +2466,10 @@ private function reindexProducts($productIdsToReindex = [])
24662466
if (is_array($productIdsToReindex) && count($productIdsToReindex) > 0 && !$indexer->isScheduled()) {
24672467
$indexer->reindexList($productIdsToReindex);
24682468
}
2469+
$indexer = $this->indexerRegistry->get('catalog_product_price');
2470+
if (is_array($productIdsToReindex) && count($productIdsToReindex) > 0 && !$indexer->isScheduled()) {
2471+
$indexer->reindexList($productIdsToReindex);
2472+
}
24692473
}
24702474

24712475
/**

app/code/Magento/CatalogImportExport/Model/Indexer/Category/Product/Plugin/Import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
public function afterImportSource(\Magento\ImportExport\Model\Import $subject, $import)
3535
{
3636
if (!$this->_indexerCategoryProductProcessor->isIndexerScheduled()) {
37-
$this->_indexerCategoryProductProcessor->markIndexerAsInvalid();
37+
//$this->_indexerCategoryProductProcessor->markIndexerAsInvalid();
3838
}
3939
return $import;
4040
}

app/code/Magento/CatalogImportExport/Model/Indexer/Product/Category/Plugin/Import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
public function afterImportSource(\Magento\ImportExport\Model\Import $subject, $import)
3535
{
3636
if (!$this->_indexerProductCategoryProcessor->isIndexerScheduled()) {
37-
$this->_indexerProductCategoryProcessor->markIndexerAsInvalid();
37+
//$this->_indexerProductCategoryProcessor->markIndexerAsInvalid();
3838
}
3939
return $import;
4040
}

app/code/Magento/CatalogImportExport/Model/Indexer/Product/Price/Plugin/Import.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ public function __construct(\Magento\Framework\Indexer\IndexerRegistry $indexerR
3030
*/
3131
public function afterImportSource(\Magento\ImportExport\Model\Import $subject, $result)
3232
{
33+
/*
3334
$priceIndexer = $this->indexerRegistry->get(\Magento\Catalog\Model\Indexer\Product\Price\Processor::INDEXER_ID);
3435
if (!$priceIndexer->isScheduled()) {
3536
$priceIndexer->invalidate();
3637
}
38+
*/
3739
return $result;
3840
}
3941
}

app/code/Magento/CatalogImportExport/Model/Indexer/Stock/Plugin/Import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(\Magento\CatalogInventory\Model\Indexer\Stock\Proces
3232
public function afterImportSource(\Magento\ImportExport\Model\Import $subject, $import)
3333
{
3434
if (!$this->_stockndexerProcessor->isIndexerScheduled()) {
35-
$this->_stockndexerProcessor->markIndexerAsInvalid();
35+
//$this->_stockndexerProcessor->markIndexerAsInvalid();
3636
}
3737
return $import;
3838
}

app/code/Magento/ImportExport/Model/Import.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ public function invalidateIndex()
690690
$indexer = $this->indexerRegistry->get($indexerId);
691691

692692
if (!$indexer->isScheduled()) {
693-
$indexer->invalidate();
693+
//$indexer->invalidate();
694694
}
695695
// phpcs:disable Magento2.CodeAnalysis.EmptyBlock.DetectedCatch
696696
} catch (\InvalidArgumentException $e) {

0 commit comments

Comments
 (0)