I am attempting to filter or query a index with geo points by using a geo_shape I have indexed already. For context, the "ais_2016_nov_zone11_enriched5" index is the one with geo points and the "ben_clusters" index has geo_shapes.
The following is what I am attempting to query with:
Any help would be appreciated. Also as a note, the geo_shapes are being stored in a field named "location", and my geo_points are being stored in a field named "GEO_POINT".
So from the documentation it seems like there is a point being stored as a geo_shape, so I would need to reindex my current data into the geo_shape type. Then run a filter for geoshape points inside the Polygon geoshapes, and then reindex them back into geo_points to visualize them on a coordinate map?
What you can do is to index them as both geo_point and geo_shape. Once you filter the documents using the geo_shape field you will have the geo_point field available if that is what you need to visualise it.
POST _reindex
{
"source": {
"index": "enrichedDataSet"
},
"dest": {
"index": "DataSetForPointShapes"
},
"script": {
"source": "ctx._source.Shape_Point",
"location": {
"type": "point",
"coordinates" : "[ctx.LAT , ctx.LON]"
}
}
}
Getting errors of "ctx is not a number" parsing error, and "[script] unknown field [location], parser not found"
I was hoping you could maybe shed some light on the proper syntax as the only references I have are for specific point inputs, which I cannot do manually.
References:
https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-shape-query.html
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.