Skip to content

Commit 320aac0

Browse files
committed
Fix doubled elastic index in alias after error
1 parent 90b9c43 commit 320aac0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Elasticsearch/Model/Adapter/Elasticsearch.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ public function addDocs(array $documents, $storeId, $mappedIndexerId)
193193
*/
194194
public function cleanIndex($storeId, $mappedIndexerId)
195195
{
196+
// needed to fix bug with double indices in alias because of second reindex in same process
197+
unset($this->preparedIndex[$storeId]);
198+
196199
$this->checkIndex($storeId, $mappedIndexerId, true);
197200
$indexName = $this->indexNameResolver->getIndexName($storeId, $mappedIndexerId, $this->preparedIndex);
198201
if ($this->client->isEmptyIndex($indexName)) {

0 commit comments

Comments
 (0)