Answer the question
In order to leave comments, you need to log in
How to use geo_distance and geo_bounding_box in the same request?
Goodnight.
I would be very grateful if you tell me how it is possible to use geo_distance and geo_bounding_box within one request in one request?
I have such a query where I pull out data from the index within a radius of 1km from the specified point.
{
"from": 0,
"size": 10,
"query": {
"bool": {
"filter": {
"geo_distance": {
"distance": "1km",
"location": "40.5586,49.6971"
}
}
}
}
}
{
"from": 0,
"size": 10,
"query": {
"bool": {
"filter": {
"geo_bounding_box": {
"location": {
"top_left": "49.1248,36.9448",
"bottom_right": "29.8779,58.3725"
}
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
After transferring geo_bounding_box to should everything worked.
{
"from": 0,
"size": 10,
"query": {
"bool": {
"filter": {
"geo_distance": {
"distance": "1km",
"location": "40.5586,49.6971"
}
},
"should": {
"geo_bounding_box": {
"location": {
"top_left": "49.1248,36.9448",
"bottom_right": "29.8779,58.3725"
}
}
}
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question