Refer to sort values by key/name


I have added a geo distance filter to my search and I have geo distance as
one of the multiple columns to sort results on.

My results bring back numbers/scores in the sort array but I was wondering
whether it was possible to refer to the distance value in the results by
name/key instead of having to refer to it by the position in the sort array
depending on how I'm sorting my results.

My results may be sorted _geo_distance,title or title,_geo_distancedepending on which the user prefers so I'd like to be able to refer to the
distance value by a key instead of referring to it by the first or second
value in the sort array.

I'm already sorting by _geo_distance so I assume the value in the sort
array is the value of _geo_distance so it would be good if I could refer
to value by *result._geo_distance *or something like that.

If it makes any difference I'm using the Tire rails gem.


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit