Added support for the bucket aggregation. (#797)
Signed-off-by: dblock <dblock@amazon.com> Co-authored-by: mckirk <mckirk@posteo.de>
This commit is contained in:
committed by
GitHub
parent
be56ae82b8
commit
def00facfb
@@ -3,6 +3,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- Added support for the `multi_terms` bucket aggregation ([#797](https://github.com/opensearch-project/opensearch-py/pull/797))
|
||||
### Changed
|
||||
- Removed deprecated `numpy.float_` and update NumPy/Pandas imports ([#762](https://github.com/opensearch-project/opensearch-py/pull/762))
|
||||
- Removed workaround for [aiohttp#1769](https://github.com/aio-libs/aiohttp/issues/1769) ([#794](https://github.com/opensearch-project/opensearch-py/pull/794))
|
||||
|
||||
@@ -308,6 +308,10 @@ class VariableWidthHistogram(Bucket):
|
||||
return FieldBucketData(self, search, data)
|
||||
|
||||
|
||||
class MultiTerms(Bucket):
|
||||
name = "multi_terms"
|
||||
|
||||
|
||||
# metric aggregations
|
||||
class TopHits(Agg):
|
||||
name = "top_hits"
|
||||
|
||||
@@ -309,6 +309,18 @@ def test_variable_width_histogram_aggregation() -> None:
|
||||
assert {"variable_width_histogram": {"buckets": 2, "field": "price"}} == a.to_dict()
|
||||
|
||||
|
||||
def test_multi_terms_aggregation() -> None:
|
||||
a = aggs.MultiTerms(terms=[{"field": "tags"}, {"field": "author.row"}])
|
||||
assert {
|
||||
"multi_terms": {
|
||||
"terms": [
|
||||
{"field": "tags"},
|
||||
{"field": "author.row"},
|
||||
]
|
||||
}
|
||||
} == a.to_dict()
|
||||
|
||||
|
||||
def test_median_absolute_deviation_aggregation() -> None:
|
||||
a = aggs.MedianAbsoluteDeviation(field="rating")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user