mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 10:04:18 +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))
|
return fmt.Errorf("failed to retrieve index disk usage: %w", esErrorString(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
dures := ResIndexDiskUsage{}
|
duRes := ResIndexDiskUsage{}
|
||||||
if err := json.Unmarshal(res, &dures); err != nil {
|
if err := json.Unmarshal(res, &duRes); err != nil {
|
||||||
return fmt.Errorf("failed to unmarshal disk usage response: %w", err)
|
return fmt.Errorf("failed to unmarshal disk usage response: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
du, exists := dures[index]
|
diskusage, exists := duRes[index]
|
||||||
if !exists {
|
if !exists {
|
||||||
return errors.New("no disk usage reported for index")
|
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).
|
table := printer.NewTableEmpty(conf).
|
||||||
WithHeaders("field", "bloom filter", "norms", "points", "term vectors", "knn vectors", "total")
|
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") {
|
if strings.HasPrefix(name, "_") || strings.HasSuffix(name, ".keyword") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -365,7 +365,7 @@ func IndexDiskusage(conf *cfg.Config, index string) error {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
all := du.AllFields
|
all := diskusage.AllFields
|
||||||
|
|
||||||
table.Sort()
|
table.Sort()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user