1
0

geo-distance-range-query.asciidoc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. [[query-dsl-geo-distance-range-query]]
  2. === Geo Distance Range Query
  3. Filters documents that exists within a range from a specific point:
  4. [source,js]
  5. --------------------------------------------------
  6. GET /_search
  7. {
  8. "query": {
  9. "bool" : {
  10. "must" : {
  11. "match_all" : {}
  12. },
  13. "filter" : {
  14. "geo_distance_range" : {
  15. "from" : "200km",
  16. "to" : "400km",
  17. "pin.location" : {
  18. "lat" : 40,
  19. "lon" : -70
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26. --------------------------------------------------
  27. // CONSOLE
  28. Supports the same point location parameter and query options as the
  29. <<query-dsl-geo-distance-query,geo_distance>>
  30. filter. And also support the common parameters for range (lt, lte, gt,
  31. gte, from, to, include_upper and include_lower).
  32. [float]
  33. ==== Ignore Unmapped
  34. When set to `true` the `ignore_unmapped` option will ignore an unmapped field
  35. and will not match any documents for this query. This can be useful when
  36. querying multiple indexes which might have different mappings. When set to
  37. `false` (the default value) the query will throw an exception if the field
  38. is not mapped.