Commit Graph

4 Commits

Author SHA1 Message Date
Hardy 12616dd9d3 Feat: Support include filter for termAggs 2021-03-12 20:54:48 +08:00
Hardy cc685d325e feat:Support for term aggs order 2021-03-12 19:37:19 +08:00
Caleb Champlin 39f0dd59c1 Add support for nested aggregations and filtered aggregations 2020-10-17 13:42:50 -06:00
Ido Perlmuter 1dd88421a2 Refactor API, add aggregations and custom queries
This commit introduces a refactor of the codebase and the API, to make
it more user friendly. Queries can now directly be executed via the
`Run()` method. Internally, the library no longer uses JSON generation
as a major mechanism, instead all types need to implement a `Mappable`
interface which simply turns each type in a `map[string]interface{}`,
which is what the ElasticSearch client expects. This makes the code
easier to write, and makes writing tests less error prone, as JSON need
not be written directly.

Support for metrics aggregations is also added. However, aggregations of
type bucket, pipeline and matrix are not supported yet.

To make the library more useful in its current state, support is added
for running custom queries and aggregations, via the `CustomQuery()` and
`CustomAgg()` functions, which both accepts an arbitrary
`map[string]interface{}`.
2020-02-20 11:50:11 +02:00