Filtering by Geo Pointedit

Four geo-point filters can be used to include or exclude documents by geolocation:

geo_bounding_box
Find geo-points that fall within the specified rectangle.
geo_distance
Find geo-points within the specified distance of a central point.
geo_distance_range
Find geo-points within a specified minimum and maximum distance from a central point.
geo_polygon
Find geo-points that fall within the specified polygon. This filter is very expensive. If you find yourself wanting to use it, you should be looking at geo-shapes instead.

All of these filters work in a similar way: the lat/lon values are loaded into memory for all documents in the index, not just the documents that match the query (see Fielddata). Each filter performs a slightly different calculation to check whether a point falls into the containing area.

Geo-filters are expensive — they should be used on as few documents as possible. First remove as many documents as you can with cheaper filters, like term or range filters, and apply the geo-filters last.

The bool filter will do this for you automatically. First it applies any bitset-based filters (see All About Caching) to exclude as many documents as it can as cheaply as possible. Then it applies the more expensive geo or script filters to each remaining document in turn.