On 9/14/2018 4:50 AM, richard.clarke wrote:
> What does it mean to sort documents by a multivalued field? If a field has
> multiple values, how can this be used to sort documents?
>
> e.g. if document 1 has a numeric field containing values 1,2,3,4,5 and
> document 2 has values in the same field of 1,2,3 - which come first in the
> sort order and why?
It's my understanding that Solr will refuse to sort on a multivalued
field, returning an error. If Solr were to make a decision to use the
first value, or the minimum value, or the maximum value ... some users
would think that was the wrong choice.
You can use a function query to have it sort on the min or max value of
a field.
https://lucidworks.com/2015/09/10/minmax-on-multivalued-field/Thanks,
Shawn