I have one index say "all_geo_docs" which contains all documents and all have a geo_shape field with type geo_shape and geo_point field with type geo_point.
Now I have one field named 'org_type' in all docs with value 'type_poly' or 'type_point'. If a value is 'type_poly' that means that doc is Polygon or else if the value is 'type_point' that means that doc is Point.
Now from the same index, I want to get all documents(with type geo_point) for which point of the doc is within 2-3 polygons(which exist in the same index with type geo_shape). I have name and id of that 2-3 polygons. How can I write geo_query for the same?
In short, I want to get all geo_point documents for which point lies within specific 2-3 polygons?
So I have only one index with 2 fields with type geo_point and geo_shape. To be clear, geo_shapes are the polygon geo-json of the boundary on google map for region. So let's say I have 10 geo_shapes. So what I want in the result is find all geo_points which fall within 2-3 of the geo_shapes.
Solution or say patch I used for the same: I was trying to use the geo_shape query with geo_point data type so this is not possible as geo_share query won't work with geo_point. So what I did is I have indexed geo_point as a geo_shape type and it's working as expected.
It's working perfectly and I don't know if it's a proper way or patch only.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.