From 10395ab992a97fd1f44fc93c86f9127e2a5ff404 Mon Sep 17 00:00:00 2001 From: lukmzig Date: Mon, 25 Nov 2024 08:43:41 +0100 Subject: [PATCH] make sure cat requests return array response --- src/SearchClient/SearchClient.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SearchClient/SearchClient.php b/src/SearchClient/SearchClient.php index 96e9738..cdcde28 100644 --- a/src/SearchClient/SearchClient.php +++ b/src/SearchClient/SearchClient.php @@ -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'); @@ -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');