How do I convert an Elasticsearch spatial query to Opendistro SQL? I know I can add the filter as an Elasticsearch DSL, but will there ever be support to do spatial queries using only SQL? Here’s what I’m looking for:
Example spatial query to search using a bounding box (Postgis):
select * from mypoints where geometry && ST_MakeEnvelope(-74.1, 40.01, -71.12, 40.73, 4326)
Instead of this:
POST _opendistro/_sql
{
"query":"select * from mypoints",
"filter": {
"geo_bounding_box": {
"geometry.coordinates": {
"top_left": {
"lat": 40.73,
"lon": -74.1
},
"bottom_right": {
"lat": 40.01,
"lon": -71.12
}
}
}
}
}
}
}