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]
|
|
|
|
--------------------------------------------------
|
2016-05-11 08:37:19 -04:00
|
|
|
GET /_search
|
2013-08-28 19:24:34 -04:00
|
|
|
{
|
2016-05-11 08:37:19 -04:00
|
|
|
"query": {
|
|
|
|
"bool" : {
|
|
|
|
"must" : {
|
|
|
|
"match_all" : {}
|
|
|
|
},
|
|
|
|
"filter" : {
|
|
|
|
"geo_distance_range" : {
|
|
|
|
"from" : "200km",
|
|
|
|
"to" : "400km",
|
|
|
|
"pin.location" : {
|
|
|
|
"lat" : 40,
|
|
|
|
"lon" : -70
|
|
|
|
}
|
|
|
|
}
|
2013-08-28 19:24:34 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2016-05-11 08:37:19 -04:00
|
|
|
// CONSOLE
|
2013-08-28 19:24:34 -04:00
|
|
|
|
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).
|
2016-04-14 06:38:48 -04:00
|
|
|
|
|
|
|
[float]
|
|
|
|
==== Ignore Unmapped
|
|
|
|
|
|
|
|
When set to `true` the `ignore_unmapped` option will ignore an unmapped field
|
|
|
|
and will not match any documents for this query. This can be useful when
|
|
|
|
querying multiple indexes which might have different mappings. When set to
|
|
|
|
`false` (the default value) the query will throw an exception if the field
|
|
|
|
is not mapped.
|