aquasecurity / esquery

An idiomatic Go query builder for ElasticSearch
Apache License 2.0
305 stars 56 forks source link

Add support for Count requests #8

Closed ido50 closed 4 years ago

ido50 commented 4 years ago

This commit adds initial support for Count requests, which are simple search requests asking to get the number of matches for a query.

The functionality is provided by the Count() function, which accepts a query object (implementing the Mappable interface), and can be executed just like a search request.

res, err := esquery.
    Count(esquery.Match("user", "someone")).
    Run(es)