summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/aggregations/metrics
diff options
context:
space:
mode:
authorChristoph Büscher <christoph@elastic.co>2017-05-23 20:15:40 +0200
committerGitHub <noreply@github.com>2017-05-23 20:15:40 +0200
commit24a8ba5ca8cd1a7f2fe43045e2f7594227643d2f (patch)
treec07878513828603e2cb200c6d7f99fa24bccfaac /core/src/main/java/org/elasticsearch/search/aggregations/metrics
parent82a369737b59b9230813841ceb7d611c22e21755 (diff)
Use ParseField constants in ParsedGeoBounds (#24849)
Diffstat (limited to 'core/src/main/java/org/elasticsearch/search/aggregations/metrics')
-rw-r--r--core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/ParsedGeoBounds.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/ParsedGeoBounds.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/ParsedGeoBounds.java
index 04d2b2448d..70abe15d29 100644
--- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/ParsedGeoBounds.java
+++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/geobounds/ParsedGeoBounds.java
@@ -48,14 +48,14 @@ public class ParsedGeoBounds extends ParsedAggregation implements GeoBounds {
@Override
public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException {
if (topLeft != null) {
- builder.startObject("bounds");
- builder.startObject("top_left");
- builder.field("lat", topLeft.getLat());
- builder.field("lon", topLeft.getLon());
+ builder.startObject(BOUNDS_FIELD.getPreferredName());
+ builder.startObject(TOP_LEFT_FIELD.getPreferredName());
+ builder.field(LAT_FIELD.getPreferredName(), topLeft.getLat());
+ builder.field(LON_FIELD.getPreferredName(), topLeft.getLon());
builder.endObject();
- builder.startObject("bottom_right");
- builder.field("lat", bottomRight.getLat());
- builder.field("lon", bottomRight.getLon());
+ builder.startObject(BOTTOM_RIGHT_FIELD.getPreferredName());
+ builder.field(LAT_FIELD.getPreferredName(), bottomRight.getLat());
+ builder.field(LON_FIELD.getPreferredName(), bottomRight.getLon());
builder.endObject();
builder.endObject();
}