diff --git a/pkg/es/index.go b/pkg/es/index.go index e1ab0f7..e90abf5 100644 --- a/pkg/es/index.go +++ b/pkg/es/index.go @@ -336,12 +336,12 @@ func IndexDiskusage(conf *cfg.Config, index string) error { return fmt.Errorf("failed to retrieve index disk usage: %w", esErrorString(err)) } - dures := ResIndexDiskUsage{} - if err := json.Unmarshal(res, &dures); err != nil { + duRes := ResIndexDiskUsage{} + if err := json.Unmarshal(res, &duRes); err != nil { return fmt.Errorf("failed to unmarshal disk usage response: %w", err) } - du, exists := dures[index] + diskusage, exists := duRes[index] if !exists { return errors.New("no disk usage reported for index") } @@ -349,7 +349,7 @@ func IndexDiskusage(conf *cfg.Config, index string) error { table := printer.NewTableEmpty(conf). WithHeaders("field", "bloom filter", "norms", "points", "term vectors", "knn vectors", "total") - for name, field := range du.Fields { + for name, field := range diskusage.Fields { if strings.HasPrefix(name, "_") || strings.HasSuffix(name, ".keyword") { continue } @@ -365,7 +365,7 @@ func IndexDiskusage(conf *cfg.Config, index string) error { ) } - all := du.AllFields + all := diskusage.AllFields table.Sort()