When crafting a distance sort, we get a wrong JSON structure:
use rs_es::units as rs_u;
use rs_es::operations::search::{Order, GeoDistance};
GeoDistance::new("coord")
.with_location(rs_u::Location::LatLon(coord.y, coord.x))
.with_order(Order::Desc)
.with_unit(rs_u::DistanceUnit::Meter)
.build();
This gives us a:
{
"field": "coord",
"location": {
"lat": 51.84222,
"lon": 5.85938
},
"order": "desc",
"unit": "m"
}
But it should be:
{
"_geo_distance": {
"coord": {
"lat": 51.84222,
"lon": 5.85938
},
"order": "desc",
"unit": "m"
}
}
When crafting a distance sort, we get a wrong JSON structure:
This gives us a:
But it should be: