When you want to get the distance in the results and you don't want to sort by distance, you need to enable the groovy scripting support of Elasticsearch.