Add CCR stuff, fix search, add docs support, support index maps, refactor (#13)

This commit is contained in:
T. von Dein
2026-05-12 18:28:57 +02:00
parent 327bc84bd8
commit dd619ab815
19 changed files with 717 additions and 237 deletions

View File

@@ -69,11 +69,7 @@ func IndexList(conf *cfg.Config) *cli.Command {
},
Action: func(ctx context.Context, cmd *cli.Command) error {
if err := es.IndexList(conf); err != nil {
return err
}
return nil
return es.IndexList(conf)
},
}
}
@@ -85,11 +81,8 @@ func IndexShow(conf *cfg.Config) *cli.Command {
Usage: "show details about an index",
Action: func(ctx context.Context, cmd *cli.Command) error {
if err := es.IndexShow(conf, cmd.Args().Get(0)); err != nil {
return err
}
return es.IndexShow(conf, cmd.Args().Get(0))
return nil
},
// FIXME: doesn't work at all
@@ -140,11 +133,14 @@ func IndexCreate(conf *cfg.Config) *cli.Command {
},
Action: func(ctx context.Context, cmd *cli.Command) error {
if err := es.IndexCreate(conf, cmd.Args().Get(0)); err != nil {
return err
args := cmd.Args()
if args.Len() == 0 {
return fmt.Errorf("no index specified")
}
return nil
mappings := args.Slice()[1:]
return es.IndexCreate(conf, args.Get(0), mappings)
},
}
}
@@ -156,11 +152,7 @@ func IndexDelete(conf *cfg.Config) *cli.Command {
Usage: "delete an index",
Action: func(ctx context.Context, cmd *cli.Command) error {
if err := es.IndexDelete(conf, cmd.Args().Get(0)); err != nil {
return err
}
return nil
return es.IndexDelete(conf, cmd.Args().Get(0))
},
}
}