We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53ce5e5 commit 5ed4d82Copy full SHA for 5ed4d82
src/Jobs/SetupIndex.php
@@ -43,7 +43,7 @@ private function migrate(ElasticaClient $elastica): void
43
try {
44
$response = $elastica->getClient()->request(sprintf('_alias/%s', $this->indexConfig->getName()));
45
} catch (ClientException|ConnectionException|ResponseException) {
46
- if (count($index->getAliases()) === 0) {
+ if ($index->exists() && count($index->getAliases()) === 0) {
47
$index->delete();
48
}
49
@@ -58,7 +58,9 @@ private function migrate(ElasticaClient $elastica): void
58
return;
59
60
61
- $index->delete();
+ if ($index->exists()) {
62
+ $index->delete();
63
+ }
64
65
66
private function cleanup(ElasticaClient $elastica): void
0 commit comments