Geo-bounding-box query #
Matches documents whose geo_point field falls inside a rectangle
defined by its top-left and bottom-right corners. Coordinates are
WGS-84 degrees; filtering only (does not contribute distance scoring).
Examples #
POST /my-collection/_search
{
"query": {
"geo_bounding_box": {
"field": "location",
"top_left_lat": 40.73,
"top_left_lon": -74.1,
"bottom_right_lat": 40.01,
"bottom_right_lon": -71.12
}
}
}
Parameters for geo_bounding_box
#
field
(Required, string) Thegeo_pointfield to filter on.top_left_lat/top_left_lon
(Required, number) Top-left corner: north latitude and west longitude.bottom_right_lat/bottom_right_lon
(Required, number) Bottom-right corner: south latitude and east longitude.top_left_lon
(Required*, number) Top-left corner longitude (west edge).bottom_right_lat/bottom_right_lon
(Required*, number) Bottom-right corner latitude (south edge) and longitude (east edge). The rectangle needstop_left_lat,top_left_lon,bottom_right_lat,bottom_right_lontogether.