A List Of Locations That Contain A Geopoint - (geo_spatial_filter_fields, Geo_distance)
I'm using elasticsearch-dsl-drf, and I just converted a single location field on my document, to a NestedField with this definition: location = fields.NestedField(properties={'poin
Solution 1:
Include "nested_path": "location"
in the geo distance sort:
{
"query":{
"nested":{
"path":"location",
"query":{
"geo_distance":{
"distance":"16090km",
"location.point":{
"lat":52.240995,
"lon":0.751156
},
"distance_type":"arc"
}
}
}
},
"sort":[
{
"_geo_distance":{
"nested_path": "location",
"location.point":{
"lat":52.240995,
"lon":0.751156
},
"unit":"km",
"distance_type":"plane",
"order":"asc"
}
},
{
"date_first_registered":{
"order":"desc"
}
}
]
}
Post a Comment for "A List Of Locations That Contain A Geopoint - (geo_spatial_filter_fields, Geo_distance)"