Skip to content

Commit

Permalink
fix(opensearch): Fix unallowed indices lookup for user with opensearch (
Browse files Browse the repository at this point in the history
#123)

Refs: #122
  • Loading branch information
MrYamous committed Nov 29, 2022
1 parent 3ba0786 commit 0f09587
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/IndexBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public function createIndex(string $indexName, array $context = []): Index

public function markAsLive(Index $index, string $indexName): Response
{
$indexName = $this->indexNameMapper->getPrefixedIndex($indexName);
$indexPrefixedName = $this->indexNameMapper->getPrefixedIndex($indexName);

$data = ['actions' => []];

$data['actions'][] = ['remove' => ['index' => '*', 'alias' => $indexName]];
$data['actions'][] = ['add' => ['index' => $index->getName(), 'alias' => $indexName]];
$data['actions'][] = ['remove' => ['index' => $indexPrefixedName . '*', 'alias' => $indexPrefixedName]];
$data['actions'][] = ['add' => ['index' => $index->getName(), 'alias' => $indexPrefixedName]];

return $this->client->request('_aliases', Request::POST, $data);
}
Expand Down

0 comments on commit 0f09587

Please sign in to comment.