geo-shape-query.asciidoc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. [[query-dsl-geo-shape-query]]
  2. === GeoShape Query
  3. Query version of the
  4. <<query-dsl-geo-shape-filter,geo_shape Filter>>.
  5. Requires the <<mapping-geo-shape-type,geo_shape
  6. Mapping>>.
  7. Given a document that looks like this:
  8. [source,js]
  9. --------------------------------------------------
  10. {
  11. "name": "Wind & Wetter, Berlin, Germany",
  12. "location": {
  13. "type": "Point",
  14. "coordinates": [13.400544, 52.530286]
  15. }
  16. }
  17. --------------------------------------------------
  18. The following query will find the point:
  19. [source,js]
  20. --------------------------------------------------
  21. {
  22. "query": {
  23. "geo_shape": {
  24. "location": {
  25. "shape": {
  26. "type": "envelope",
  27. "coordinates": [[13, 53],[14, 52]]
  28. }
  29. }
  30. }
  31. }
  32. }
  33. --------------------------------------------------
  34. See the Filter's documentation for more information.
  35. [float]
  36. ==== Relevancy and Score
  37. Currently Elasticsearch does not have any notion of geo shape relevancy,
  38. consequently the Query internally uses a `constant_score` Query which
  39. wraps a <<query-dsl-geo-shape-filter,geo_shape
  40. filter>>.