mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 11:34:17 +02:00
Add CCR stuff, fix search, add docs support, support index maps, refactor (#13)
This commit is contained in:
@@ -34,9 +34,17 @@ Execute an ES search.
|
||||
q is the actual search query given as arg to the 'search' cmd
|
||||
additional filters can be given as -F key=value
|
||||
*/
|
||||
func Search(conf *cfg.Config, q string) error {
|
||||
query := esdsl.NewBoolQuery().
|
||||
Must(esdsl.NewMatchQuery("message", q))
|
||||
func Search(conf *cfg.Config, queries []string) error {
|
||||
query := esdsl.NewBoolQuery()
|
||||
|
||||
for _, q := range queries {
|
||||
parts := strings.Split(q, "=")
|
||||
if len(parts) != 2 {
|
||||
return fmt.Errorf("search queries must be in the form field=pattern")
|
||||
}
|
||||
|
||||
query.Must(esdsl.NewMatchQuery(parts[0], parts[1]))
|
||||
}
|
||||
|
||||
filters := make([]types.QueryVariant, len(conf.Filter))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user