From 2a3761e646f1cfdffc78bc85612ee264e48a1199 Mon Sep 17 00:00:00 2001 From: Mahan Zendedel DH Date: Sun, 14 Apr 2024 18:00:52 +0400 Subject: [PATCH] fix: list indices --- pkg/kaytu-es-sdk/index.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/kaytu-es-sdk/index.go b/pkg/kaytu-es-sdk/index.go index f326591..691520d 100644 --- a/pkg/kaytu-es-sdk/index.go +++ b/pkg/kaytu-es-sdk/index.go @@ -34,7 +34,10 @@ func (c Client) CreateIndexIfNotExist(ctx context.Context, logger *zap.Logger, i } func (c Client) ListIndices(ctx context.Context, logger *zap.Logger) ([]string, error) { - res, err := c.es.Cat.Indices(c.es.Cat.Indices.WithBytes("{}"), c.es.Cat.Indices.WithContext(ctx)) + res, err := c.es.Cat.Indices( + c.es.Cat.Indices.WithContext(ctx), + c.es.Cat.Indices.WithFormat("json"), + ) defer CloseSafe(res) if err != nil { logger.Error("failure while listing indices", zap.Error(err), zap.Any("response", res))