Skip to content

Commit

Permalink
Don't allow sub-aggregations for metrics aggregators.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattweber committed Mar 17, 2014
1 parent 097055f commit 6f4937a
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 123 deletions.
25 changes: 5 additions & 20 deletions dist/elastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,6 @@

@name ejs.MetricsAggregationMixin
@ejs aggregation
@borrows ejs.AggregationMixin.aggregation as aggregation
@borrows ejs.AggregationMixin.agg as agg
@borrows ejs.AggregationMixin._type as _type
@borrows ejs.AggregationMixin.toJSON as toJSON

Expand All @@ -775,6 +773,11 @@
_common = ejs.AggregationMixin(name),
agg = _common.toJSON();

// remove ability for sub-aggregations since metrics aggregations dont
// support them.
delete _common.aggregation;
delete _common.agg;

agg[name][type] = {};

return extend(_common, {
Expand Down Expand Up @@ -3010,8 +3013,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down Expand Up @@ -3043,8 +3044,6 @@
@borrows ejs.MetricsAggregationMixin.script as script
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down Expand Up @@ -3125,8 +3124,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down Expand Up @@ -3551,8 +3548,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down Expand Up @@ -3586,8 +3581,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down Expand Up @@ -3717,8 +3710,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down Expand Up @@ -4202,8 +4193,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down Expand Up @@ -4237,8 +4226,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down Expand Up @@ -4582,8 +4569,6 @@
@borrows ejs.MetricsAggregationMixin.script as script
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON

Expand Down
4 changes: 2 additions & 2 deletions dist/elastic.min.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/aggregations/AvgAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
2 changes: 0 additions & 2 deletions src/aggregations/CardinalityAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
@borrows ejs.MetricsAggregationMixin.script as script
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
2 changes: 0 additions & 2 deletions src/aggregations/ExtendedStatsAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
2 changes: 0 additions & 2 deletions src/aggregations/MaxAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
2 changes: 0 additions & 2 deletions src/aggregations/MinAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
2 changes: 0 additions & 2 deletions src/aggregations/PercentilesAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
2 changes: 0 additions & 2 deletions src/aggregations/StatsAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
2 changes: 0 additions & 2 deletions src/aggregations/SumAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.scriptValuesSorted as scriptValuesSorted
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
2 changes: 0 additions & 2 deletions src/aggregations/ValueCountAggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
@borrows ejs.MetricsAggregationMixin.script as script
@borrows ejs.MetricsAggregationMixin.lang as lang
@borrows ejs.MetricsAggregationMixin.params as params
@borrows ejs.MetricsAggregationMixin.aggregation as aggregation
@borrows ejs.MetricsAggregationMixin.agg as agg
@borrows ejs.MetricsAggregationMixin._type as _type
@borrows ejs.MetricsAggregationMixin.toJSON as toJSON
Expand Down
7 changes: 5 additions & 2 deletions src/mixins/MetricsAggregationMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
@name ejs.MetricsAggregationMixin
@ejs aggregation
@borrows ejs.AggregationMixin.aggregation as aggregation
@borrows ejs.AggregationMixin.agg as agg
@borrows ejs.AggregationMixin._type as _type
@borrows ejs.AggregationMixin.toJSON as toJSON
Expand All @@ -18,6 +16,11 @@
_common = ejs.AggregationMixin(name),
agg = _common.toJSON();

// remove ability for sub-aggregations since metrics aggregations dont
// support them.
delete _common.aggregation;
delete _common.agg;

agg[name][type] = {};

return extend(_common, {
Expand Down
Loading

0 comments on commit 6f4937a

Please sign in to comment.