mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 04:54:18 +02:00
add doc show, enhance search, add jsonpath to search and doc show
This commit is contained in:
@@ -129,6 +129,13 @@ func IndexShow(conf *cfg.Config, index string) error {
|
||||
|
||||
slog.Debug("ES result", "index", res)
|
||||
|
||||
fields := make([]string, len(res[index].Mappings.Properties))
|
||||
idx := 0
|
||||
for field := range res[index].Mappings.Properties {
|
||||
fields[idx] = field
|
||||
idx++
|
||||
}
|
||||
|
||||
table := printer.NewTable(conf, 2, 5)
|
||||
table.Addheaders("index property", "value")
|
||||
|
||||
@@ -145,6 +152,7 @@ func IndexShow(conf *cfg.Config, index string) error {
|
||||
{"shards", *res[index].Settings.Index.NumberOfShards},
|
||||
{"created", created.Format("2006-01-02 15:04:05")},
|
||||
{"uuid", *res[index].Settings.Index.Uuid},
|
||||
{"fields", strings.Join(fields, ",")},
|
||||
}
|
||||
|
||||
if err := table.Print(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user