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
This commit is contained in:
Caleb Champlin
2021-03-14 09:50:22 +02:00
committed by GitHub
parent 259a3cd818
commit fc16427405
11 changed files with 954 additions and 7 deletions
+34
View File
@@ -58,5 +58,39 @@ func TestAggregations(t *testing.T) {
},
},
},
{
"a complex, multi-aggregation, nested",
Aggregate(
NestedAgg("categories","categories").
Aggs(TermsAgg("type","outdoors")),
FilterAgg("filtered",
Term("type", "t-shirt")),
),
map[string]interface{}{
"aggs": map[string]interface{}{
"categories": map[string]interface{}{
"nested": map[string]interface{}{
"path": "categories",
},
"aggs": map[string]interface{} {
"type": map[string]interface{} {
"terms": map[string]interface{} {
"field": "outdoors",
},
},
},
},
"filtered": map[string]interface{}{
"filter": map[string]interface{}{
"term": map[string]interface{}{
"type": map[string]interface{} {
"value": "t-shirt",
},
},
},
},
},
},
},
})
}