mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 09:44:17 +02:00
rename var
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user