Elasticsearch: estimate distance by distance and return without calculating the distance twice

I searched many times and searched from a distance. I need to use script_scoreand return the distance that I need to use script_fields, but could not find a solution that would combine the two queries or common data between them. Therefore, I calculate the distance twice. How can I avoid calculating the distance twice and instead calculate it only once?

+4
source share

Source: https://habr.com/ru/post/1625237/


All Articles