Yes. But there is a bug in the documentation. It is showing a wrong code in https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-geo-queries.html#java-query-dsl-geo-distance-query
I opened:
In the meantime, look at:
1 Like
Tried this way
modified code, is it correct?
afb = QueryBuilders.geoDistanceQuery("location").geoDistance(GeoDistance.PLANE).point(latitude, longitude).distance(mile,DistanceUnit.MILES);
for below code (actual code)
afb.add(QueryBuilders.geoDistanceQuery("location")
.lat(latitude).lon(longitude)
.distance(mile, DistanceUnit.MILES).optimizeBbox("memory"))
It looks good.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.