Skip to content

Commit 66b7662

Browse files
authored
Merge pull request #361 from pimcore/fix-index-update-after-ClassificationStore-type-change
[Bug, EC] PEES-815: classification type change - generic data index update
1 parent 0aed5c1 commit 66b7662

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/SearchIndexAdapter/DefaultSearch/DefaultSearchService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function reindex(string $indexName, array $mapping): void
118118
try {
119119
$this->client->reIndex(['body' => $body]);
120120
} catch (Exception $e) {
121-
$this->logger->error('Reindexing failed due to following error: ' . $e);
121+
throw $e;
122122
}
123123

124124
$this->switchIndexAliasAndCleanup($indexName, $oldIndexName, $newIndexName);

src/Service/SearchIndex/IndexService/IndexHandler/AbstractIndexHandler.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,18 @@ public function reindexMapping(
7474
mappingProperties: $mappingProperties
7575
);
7676
} else {
77-
$this->searchIndexService->reindex(
78-
$alias,
79-
$mappingProperties
80-
);
77+
try {
78+
$this->searchIndexService->reindex(
79+
$alias,
80+
$mappingProperties
81+
);
82+
} catch (Exception $e) {
83+
try {
84+
$this->updateMapping($context, true, $mappingProperties);
85+
} catch (Exception $e) {
86+
$this->logger->error('Reindexing failed due to following error: ' . $e);
87+
}
88+
}
8189
}
8290

8391
$this->createGlobalIndexAliases($context);

0 commit comments

Comments
 (0)