Followup to #381, we are ending up with "duplicated" indices where both the even and odd versions continue to exist:
{
"health": "green",
"status": "open",
"index": "pimcore_data-object_product-even",
"uuid": "XUv3-r7iQ3uNVPAfaPVAug",
"pri": "1",
"rep": "0",
"docs.count": "17284",
"docs.deleted": "0",
"store.size": "35.6mb",
"pri.store.size": "35.6mb"
},
{
"health": "green",
"status": "open",
"index": "pimcore_data-object_product-odd",
"uuid": "kPLlKMchQZOc0PdNKErV7A",
"pri": "1",
"rep": "0",
"docs.count": "11709",
"docs.deleted": "66",
"store.size": "29.9mb",
"pri.store.size": "29.9mb"
},
based on my read here:
|
private function switchIndexAliasAndCleanup(string $aliasName, string $oldIndexName, string $newIndexName): void |
|
{ |
|
$params['body'] = [ |
|
'actions' => [ |
|
[ |
|
'remove' => [ |
|
'index' => $aliasName . '*', |
|
'alias' => $aliasName, |
|
], |
|
], |
|
[ |
|
'add' => [ |
|
'index' => $newIndexName, |
|
'alias' => $aliasName, |
|
], |
|
], |
|
], |
|
]; |
|
|
|
$result = $this->client->updateIndexAliases($params); |
|
if (!$result['acknowledged']) { |
|
throw new SwitchIndexAliasException('Switching Alias failed for ' . $newIndexName); |
|
} |
|
|
|
$this->deleteIndex($oldIndexName); |
|
} |
the old index should be deleted when swapping.
Followup to #381, we are ending up with "duplicated" indices where both the even and odd versions continue to exist:
{ "health": "green", "status": "open", "index": "pimcore_data-object_product-even", "uuid": "XUv3-r7iQ3uNVPAfaPVAug", "pri": "1", "rep": "0", "docs.count": "17284", "docs.deleted": "0", "store.size": "35.6mb", "pri.store.size": "35.6mb" }, { "health": "green", "status": "open", "index": "pimcore_data-object_product-odd", "uuid": "kPLlKMchQZOc0PdNKErV7A", "pri": "1", "rep": "0", "docs.count": "11709", "docs.deleted": "66", "store.size": "29.9mb", "pri.store.size": "29.9mb" },based on my read here:
generic-data-index-bundle/src/SearchIndexAdapter/DefaultSearch/DefaultSearchService.php
Lines 302 to 327 in f76d347
the old index should be deleted when swapping.