geo-distance-range-query.asciidoc 837 B

123456789101112131415161718192021222324252627282930
  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. "boost" : {
  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).