Hi guys. I would like to get you insight on what is the best approach to use radius filtering - i.e. get points which are within a given range from the specified center.
In Java API there are two ways, based on the format in which points coordinates are stored.
1). Coordinate has a "geo_point" mapping:
Then query will look like:
QueryBuilder qb = QueryBuilders.geoDistanceQuery("location")
2). Coordinate has a "geo_shape" mapping:
Query will look like this:
QueryBuilder qb = QueryBuilders.geoShapeQuery("location",
Both queries yield the same result. However, I am not sure which one is a recommended approach.
In my application one of the coordinates has to be geo_shape - because I perform other geo shape queries on it (like find points within geo_shape polygon). Now the question is, should I add another field for storing the same coordinates in geo_point format (in addition to geo_shape) - just for the sake of using geo distance query? Will it provide any performance benefits as compared to approach 2)?