Commit Graph

7 Commits

Author SHA1 Message Date
Jacky Wu 2a3074fe89 doc: add date histogram agg in supported agg function list. 2022-01-21 14:15:54 +08:00
Caleb Champlin fc16427405
Features: Filter Aggregations, Nested Aggregations, Multi Match Queries, Highlights (#12)
* Add support for multi_match queries

* Add support for highlights

* Add support for nested aggregations and filtered aggregations

* Update README

* Fix formatting
2021-03-14 09:50:22 +02:00
Ido Perlmuter 8e5dea816b
Add Search() function, two new aggregations (#7)
This commit implements a Search() function, which allow for running
search requests with both a query and aggregations. This function is
meant to more accurately implement the structure of search requests
accepted by ElasticSearch's Search API.

The Query() and Aggregate() functions are still included by the library,
but now simply call Search() internally, making them simple shortcuts.

Two new aggregations are also added: "terms" and "top_hits". These are
implemented a bit differently than previously implemented ones. The
structs and methods for ElasticSearch queries and aggregations will
eventually be auto-generated from a specification file, and will look
more like the new implementations of these new aggregations.
2020-04-06 12:03:42 +03:00
oranmoshai 36e63bac30 Add trvis-ci 2020-02-23 12:29:45 +02:00
Ido Perlmuter 8de6de1468 Improve README
Add shields, TOC and more information to the README file.
2020-02-20 11:58:45 +02: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
Ido Perlmuter 55000abc77 Add Search() function, README and fix some lint errors
This commit changes the internal `search()` function into an exposed
`Search()` function that can be used to execute queries against an
instance of an ElasticSearch client. The per-query-type methods of
`Run()` are removed for now to prevent having to create them for every
type. `Search()` is agnostic.

A README.md file is added with some information, and a few lingering
lint errors are fixed.
2020-02-20 11:50:11 +02:00