Efficiency of distance calculations

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

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

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