According to this link describing adding sorting by nested fields in ElasticSearch :
During sorting, either the highest (maximum) or the minimum (minimum) internal object is selected, depending on the sort_mode used.
Is there any way, instead of using the maximum or minimum value, it uses the first value of the array? For example, if the entry looks like this:
{
"title": "Blah blah blah",
"authors": [
{
"last": "Reiter",
"first": "Jordan",
},
{
"last": "Jim",
"first": "Lee",
}
]
}
And I want to sort by authors.last, authors.firstfor this record to use Reiter, Jordanfor sorting?
source
share