add doc show, enhance search, add jsonpath to search and doc show

This commit is contained in:
T. von Dein
2026-05-22 13:50:17 +02:00
parent 89e2498aad
commit 98a577f68a
10 changed files with 348 additions and 52 deletions

View File

@@ -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 {