is there an option to perform search using one query in ElasticSearch like that:
?
Yes, you can use pre-indexed shapes for this purpose.
POST /_search
{
"query": {
"bool": {
"must": {
"match_all": {}
},
"filter": {
"geo_shape": {
"your_shape_field": {
"indexed_shape": {
"id": "1",
"type": "your_type",
"index": "your_index",
"path": "shape"
},
"relation": "intersects"
}
}
}
}
}
}
This query will return all documents having your_shape_field
intersect the shape
field in document with id 1.