geo-distance-range-query.asciidoc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. {
  7. "bool" : {
  8. "must" : {
  9. "match_all" : {}
  10. },
  11. "filter" : {
  12. "geo_distance_range" : {
  13. "from" : "200km",
  14. "to" : "400km",
  15. "pin.location" : {
  16. "lat" : 40,
  17. "lon" : -70
  18. }
  19. }
  20. }
  21. }
  22. }
  23. --------------------------------------------------
  24. Supports the same point location parameter and query options as the
  25. <<query-dsl-geo-distance-query,geo_distance>>
  26. filter. And also support the common parameters for range (lt, lte, gt,
  27. gte, from, to, include_upper and include_lower).
  28. [float]
  29. ==== Ignore Unmapped
  30. When set to `true` the `ignore_unmapped` option will ignore an unmapped field
  31. and will not match any documents for this query. This can be useful when
  32. querying multiple indexes which might have different mappings. When set to
  33. `false` (the default value) the query will throw an exception if the field
  34. is not mapped.