Skip to content

Commit

Permalink
make sure cat requests return array response
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Nov 25, 2024
1 parent f631f05 commit 10395ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SearchClient/SearchClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ public function closeIndex(array $params): array
public function getAllIndices(array $params): array
{
try {
$params = array_merge($params, ['format' => 'json']);

return $this->getArrayResponse($this->client->cat()->indices($params));
} catch (Exception $exception) {
return $this->handleExceptionsWithArray($exception, 'Failed to get all indices');
Expand Down Expand Up @@ -307,6 +309,8 @@ public function deleteIndexAlias(array $params): array
public function getAllIndexAliases(array $params): array
{
try {
$params = array_merge($params, ['format' => 'json']);

return $this->getArrayResponse($this->client->cat()->aliases($params));
} catch (Exception $exception) {
return $this->handleExceptionsWithArray($exception, 'Failed to get all index Aliases');
Expand Down

0 comments on commit 10395ab

Please sign in to comment.