Efficiency of distance calculations


(Greg) #1

If I sort by "_geo_distance" and add a "geo_distance" filter, both
using the same location as the origin, does ES calculate the distances
twice, or does it cache and re-use this information? If it is cached,
how long for?

Many thanks
Greg


(Shay Banon) #2

The distance calculation is not cached (debatable if caching will actually be slower..., need to test and see). The values for lat and lon are "cached".
On Tuesday, May 17, 2011 at 10:18 PM, Greg wrote:

If I sort by "_geo_distance" and add a "geo_distance" filter, both
using the same location as the origin, does ES calculate the distances
twice, or does it cache and re-use this information? If it is cached,
how long for?

Many thanks
Greg


(Greg) #3

Thanks Shay!

On May 17, 8:21 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

The distance calculation is not cached (debatable if caching will actually be slower..., need to test and see). The values for lat and lon are "cached".

On Tuesday, May 17, 2011 at 10:18 PM, Greg wrote:

If I sort by "_geo_distance" and add a "geo_distance" filter, both
using the same location as the origin, does ES calculate the distances
twice, or does it cache and re-use this information? If it is cached,
how long for?

Many thanks
Greg


(system) #4