geo-polygon-query.asciidoc 592 B

123456789101112131415161718
  1. [[java-query-dsl-geo-polygon-query]]
  2. ==== Geo Polygon Query
  3. See {ref}/query-dsl-geo-polygon-query.html[Geo Polygon Query]
  4. [source,java]
  5. --------------------------------------------------
  6. List<GeoPoint> points = new ArrayList<GeoPoint>(); <1>
  7. points.add(new GeoPoint(40, -70));
  8. points.add(new GeoPoint(30, -80));
  9. points.add(new GeoPoint(20, -90));
  10. QueryBuilder qb =
  11. geoPolygonQuery("pin.location", points); <2>
  12. --------------------------------------------------
  13. <1> add your polygon of points a document should fall within
  14. <2> initialise the query with field and points