From 001ee8b79f93cfa8a1062ca079e85396a2de21c3 Mon Sep 17 00:00:00 2001 From: thomas-sc Date: Wed, 4 Dec 2024 09:42:22 +0100 Subject: [PATCH] change selection of indexes to delete from wildcard alias to "zotero-index" alias --- Classes/Command/IndexCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Command/IndexCommand.php b/Classes/Command/IndexCommand.php index e357435..0488941 100644 --- a/Classes/Command/IndexCommand.php +++ b/Classes/Command/IndexCommand.php @@ -457,7 +457,7 @@ protected function swapIndexAliases(string $indexName, string $tempIndexAlias): protected function deleteOldIndexes($indexName): void { try { - $aliasesRequest = $this->client->indices()->getAlias(['name' => $this->extConf['elasticIndexName'].'_*']); + $aliasesRequest = $this->client->indices()->getAlias(['name' => $this->extConf['elasticIndexName'].'-index']); $aliasesArray = $aliasesRequest->asArray(); // sort $aliasesArray by key name @@ -478,10 +478,10 @@ protected function deleteOldIndexes($indexName): void catch (\Exception $e) { // other versions return a Message object if ($e->getCode() === 404) { - $this->io->note("Nothing to remove, there are no indexes with alias " . $this->extConf['elasticIndexName'].'_*'); + $this->io->note("Nothing to remove, there are no indexes with alias " . $this->extConf['elasticIndexName'].'-index'); } else { $this->io->error("Exception: " . $e->getMessage()); - $this->logger->error('Bibliography sync unsuccessful. Error getting alias: ' . $this->extConf['elasticIndexName'].'_*'); + $this->logger->error('Bibliography sync unsuccessful. Error getting alias: ' . $this->extConf['elasticIndexName'].'-index'); throw new \Exception('Bibliography sync unsuccessful.', 0, $e); } }