2015-05-05 02:27:52 -04:00
|
|
|
[[query-dsl-geo-distance-range-query]]
|
2015-06-03 19:59:22 -04:00
|
|
|
=== 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]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
2015-10-18 04:15:10 -04:00
|
|
|
"bool" : {
|
2015-09-11 04:35:56 -04:00
|
|
|
"must" : {
|
2013-08-28 19:24:34 -04:00
|
|
|
"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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2015-08-07 16:55:22 -04:00
|
|
|
Supports the same point location parameter and query options 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).
|