Difference of distance calculation between ES version 1.7.4 and 6.3.2 (distanceInkm in 1.7.4 vs arcDistance in 6.3.2)


I have recently upgraded ES from 1.7.4 to 6.3.2. After upgrading the distance calculation between the given point and geopoints in ES are showing different results.
For example, in 1.7.4, distance between 2 geo points were say 2.1kms
However, in 6.3.2, it is showing 1.9kms

The 1.7.4 query script is as follows:
"script": "doc['distributer.geolocation'].distanceInkm(lat,lon)"

in 6.3.2, the script used is:
"source": "doc['distributer.geolocation'].arcDistance(params.lat,params.lon) * .001"
(.001 is to convert meter to km)


Based on these docs it seems distanceInKm calculated a plane distance while you are comparing it to an arcDistance.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.