Having an issue with geo distance sorting with elasticsearch where an error is being returned when attempting to define the location pin. Using the Elastica PHP client.
$base->addSort([
'_geo_distance' => [
'location' => $location,
'order' => 'asc',
'unit' => 'm'
]
]);
The error is;
illegal latitude value [269.58378318697214] for [GeoDistanceSort] [reason: all shards failed]
This suggests the value of the latitude is >180 but the value is only 51.561965753874624 with a longitude of -0.38245278430174103 (as retrieved from google maps).
I've checked the values are still as above before they are entered into the sort function.