-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
The GeoHashGrid class is used as the interface for the geohash_grid aggregation. It currently has a getKey() method which returns a GeoPoint and a getKeyAsString() method that returns the String of the geohash for that bucket. The REST API only returns the String geohash and this is in the key field of the bucket.
I think it would be better for the getKey() method to return the string representation of the geohash and to get rid of the getKeyAsString() method. Having the ability to get a GeoPoint from a bucket that represents a geohash cell is misleading because the cell does not represent a point but an area. Having it return a bounding box will also not suffice given that with the addition of #30320 the cells may not be rectangular. Therefore I think we should remove the ability to get a GeoPoint from this aggregation and give the client the decision on how to represent the bucket key in their application.
This will also help implementing the high level rest client aspects of #30320 as the client will not need to know about the GeoHashType being used and will only care that there is some string key for the buckets.