I've an index with Polygons of countries and what I want to do is to calculate given some coordinates, to witch country belongs.
I've tried in a lot of ways and I get always all my index as a result. It is even posible to do that with elasticsearch?
This is my mapping (summarized to show only the interesting part for this question):
{
properties: {
geometry: { 'type': 'geo_shape' }
}
}
This is the last query that I've tried:
{
"query":{
"bool":{
"must":{
"match_all":{
}
},
"filter":{
"geo_shape":{
"geometry":{
"shape":{
"type":"point",
"coordinates":[
2.217779,
41.398349
]
},
"relation":"intersects"
}
}
}
}
}
}
More information:
- My field
geometryonly can be Polygon or MultiPolygon - All the points that I want to use to search after I have them in Geojson format (but of course I can transform it to any format if needed)