@@ -14,16 +14,14 @@ package elastic
14
14
type CumulativeSumAggregation struct {
15
15
format string
16
16
17
- subAggregations map [string ]Aggregation
18
- meta map [string ]interface {}
19
- bucketsPaths []string
17
+ meta map [string ]interface {}
18
+ bucketsPaths []string
20
19
}
21
20
22
21
// NewCumulativeSumAggregation creates and initializes a new CumulativeSumAggregation.
23
22
func NewCumulativeSumAggregation () * CumulativeSumAggregation {
24
23
return & CumulativeSumAggregation {
25
- subAggregations : make (map [string ]Aggregation ),
26
- bucketsPaths : make ([]string , 0 ),
24
+ bucketsPaths : make ([]string , 0 ),
27
25
}
28
26
}
29
27
@@ -32,12 +30,6 @@ func (a *CumulativeSumAggregation) Format(format string) *CumulativeSumAggregati
32
30
return a
33
31
}
34
32
35
- // SubAggregation adds a sub-aggregation to this aggregation.
36
- func (a * CumulativeSumAggregation ) SubAggregation (name string , subAggregation Aggregation ) * CumulativeSumAggregation {
37
- a .subAggregations [name ] = subAggregation
38
- return a
39
- }
40
-
41
33
// Meta sets the meta data to be included in the aggregation response.
42
34
func (a * CumulativeSumAggregation ) Meta (metaData map [string ]interface {}) * CumulativeSumAggregation {
43
35
a .meta = metaData
@@ -68,19 +60,6 @@ func (a *CumulativeSumAggregation) Source() (interface{}, error) {
68
60
params ["buckets_path" ] = a .bucketsPaths
69
61
}
70
62
71
- // AggregationBuilder (SubAggregations)
72
- if len (a .subAggregations ) > 0 {
73
- aggsMap := make (map [string ]interface {})
74
- source ["aggregations" ] = aggsMap
75
- for name , aggregate := range a .subAggregations {
76
- src , err := aggregate .Source ()
77
- if err != nil {
78
- return nil , err
79
- }
80
- aggsMap [name ] = src
81
- }
82
- }
83
-
84
63
// Add Meta data if available
85
64
if len (a .meta ) > 0 {
86
65
source ["meta" ] = a .meta
0 commit comments