File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,10 @@ class AutoDateHistogram(DateHistogram):
197197 name = "auto_date_histogram"
198198
199199
200+ class AdjacencyMatrix (Bucket ):
201+ name = "adjacency_matrix"
202+
203+
200204class DateRange (Bucket ):
201205 name = "date_range"
202206
@@ -385,6 +389,10 @@ class Sum(Agg):
385389 name = "sum"
386390
387391
392+ class TopMetrics (Agg ):
393+ name = "top_metrics"
394+
395+
388396class TTest (Agg ):
389397 name = "t_test"
390398
Original file line number Diff line number Diff line change @@ -449,3 +449,30 @@ def test_random_sampler_aggregation():
449449 },
450450 },
451451 } == a .to_dict ()
452+
453+
454+ def test_adjancecy_matrix_aggregation ():
455+ a = aggs .AdjacencyMatrix (
456+ filters = {
457+ "grpA" : {"terms" : {"accounts" : ["hillary" , "sidney" ]}},
458+ "grpB" : {"terms" : {"accounts" : ["donald" , "mitt" ]}},
459+ "grpC" : {"terms" : {"accounts" : ["vladimir" , "nigel" ]}},
460+ }
461+ )
462+ assert {
463+ "adjacency_matrix" : {
464+ "filters" : {
465+ "grpA" : {"terms" : {"accounts" : ["hillary" , "sidney" ]}},
466+ "grpB" : {"terms" : {"accounts" : ["donald" , "mitt" ]}},
467+ "grpC" : {"terms" : {"accounts" : ["vladimir" , "nigel" ]}},
468+ }
469+ }
470+ } == a .to_dict ()
471+
472+
473+ def test_top_metrics_aggregation ():
474+ a = aggs .TopMetrics (metrics = {"field" : "m" }, sort = {"s" : "desc" })
475+
476+ assert {
477+ "top_metrics" : {"metrics" : {"field" : "m" }, "sort" : {"s" : "desc" }}
478+ } == a .to_dict ()
You can’t perform that action at this time.
0 commit comments