We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9356d2 commit 20abf2aCopy full SHA for 20abf2a
1 file changed
src/Model/Indices/MoveAlias.php
@@ -18,30 +18,25 @@ public function __construct(
18
public function execute(string $alias, string $indexFrom, string $indexTo): array
19
{
20
try {
21
- return $this->clientProvider->client()->indices()->putAlias(
22
- (
23
- new \Spameri\ElasticQuery\Document(
24
- $indexFrom,
25
- new \Spameri\ElasticQuery\Document\Body\Plain(
26
- [
27
- 'actions' => [
+ return $this->clientProvider->client()->indices()->updateAliases(
+ [
+ 'body' => [
+ 'actions' => [
28
'remove' => [
29
'index' => $indexFrom,
30
'alias' => $alias,
31
],
+ ],
32
'add' => [
33
'index' => $indexTo,
34
35
36
37
38
- ),
39
- null,
40
41
- 'name' => $indexTo,
42
43
- )
44
- )->toArray(),
45
)->asArray()
46
;
47
0 commit comments