Skip to content

Commit c33d112

Browse files
committed
keep default precision updated
1 parent 6c16a85 commit c33d112

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public static GeoGridAggregationBuilder parse(String aggregationName, XContentPa
119119
*/
120120
private XContentLocation precisionLocation = null;
121121

122-
private int precision = Integer.MIN_VALUE;
122+
private int precision = GeoHashType.DEFAULT.getHandler().getDefaultPrecision();
123123

124124
private int requiredSize = DEFAULT_MAX_NUM_CELLS;
125125
private int shardSize = -1;
@@ -171,6 +171,9 @@ public GeoGridAggregationBuilder type(String type) {
171171
.collect(Collectors.joining(", ")) +
172172
". Found [" + type + "] in [" + name + "]");
173173
}
174+
// Some tests bypass parsing steps, so keep the default precision consistent.
175+
// Note that tests must set precision after setting the type
176+
this.precision = this.type.getHandler().getDefaultPrecision();
174177
return this;
175178
}
176179

0 commit comments

Comments
 (0)