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

View File

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

View File

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