Skip to content

Commit

Permalink
fix: list indices
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahanmmi committed Apr 14, 2024
1 parent 87c0cfe commit 2a3761e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/kaytu-es-sdk/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2a3761e

Please sign in to comment.