- Find geo-points that fall within the specified rectangle.
- Find geo-points within the specified distance of a central point.
- Find geo-points within a specified minimum and maximum distance from a central point.
- 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
range filters, and apply the geo-filters last.
bool filter will do this for you automatically.
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.