2015-05-05 02:27:52 -04:00
|
|
|
[[query-dsl-geo-distance-range-query]]
|
|
|
|
== Geo Distance Range Query
|
2013-08-28 19:24:34 -04:00
|
|
|
|
|
|
|
Filters documents that exists within a range from a specific point:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"filtered" : {
|
|
|
|
"query" : {
|
|
|
|
"match_all" : {}
|
|
|
|
},
|
|
|
|
"filter" : {
|
|
|
|
"geo_distance_range" : {
|
|
|
|
"from" : "200km",
|
2015-05-04 10:29:37 -04:00
|
|
|
"to" : "400km",
|
2013-08-28 19:24:34 -04:00
|
|
|
"pin.location" : {
|
|
|
|
"lat" : 40,
|
|
|
|
"lon" : -70
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
Supports the same point location parameter as the
|
2015-05-05 02:27:52 -04:00
|
|
|
<<query-dsl-geo-distance-query,geo_distance>>
|
2013-08-28 19:24:34 -04:00
|
|
|
filter. And also support the common parameters for range (lt, lte, gt,
|
|
|
|
gte, from, to, include_upper and include_lower).
|