Aggregations: More consistent response format for scripted metrics aggregation

Changes the name of the field in the scripted metrics aggregation from 'aggregation' to 'value' to be more in line with the other metrics aggregations like 'avg'
This commit is contained in:
Colin Goodheart-Smithe 2014-09-16 17:03:54 +01:00
parent dd2ef8e014
commit 8a70b115f2
2 changed files with 3 additions and 3 deletions
docs/reference/search/aggregations/metrics
src/main/java/org/elasticsearch/search/aggregations/metrics/scripted

@ -46,7 +46,7 @@ The response for the above aggregation:
"aggregations": { "aggregations": {
"profit": { "profit": {
"aggregation": 170 "value": 170
} }
} }
} }
@ -207,7 +207,7 @@ produce the response:
"aggregations": { "aggregations": {
"profit": { "profit": {
"aggregation": 170 "value": 170
} }
} }
} }

@ -134,7 +134,7 @@ public class InternalScriptedMetric extends InternalMetricsAggregation implement
@Override @Override
public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException { public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException {
return builder.field("aggregation", aggregation); return builder.field("value", aggregation);
} }
} }