New

The executive guide to generative AI

Read more
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.

GeoDistance Filter

edit

See Geo Distance Filter

FilterBuilder filter = geoDistanceFilter("pin.location")    
    .point(40, -70)                                         
    .distance(200, DistanceUnit.KILOMETERS)                 
    .optimizeBbox("memory")                                 
    .geoDistance(GeoDistance.ARC);                          

field

center point

distance from center point

optimize bounding box: memory, indexed or none

distance computation mode: GeoDistance.SLOPPY_ARC (default), GeoDistance.ARC (slightly more precise but significantly slower) or GeoDistance.PLANE (faster, but inaccurate on long distances and close to the poles)

Note that you can cache the result using GeoDistanceFilterBuilder#cache(boolean) method. See Caching.

Was this helpful?
Feedback