The easiest way is to have a separate field for sorting. Make it
DocValue as well for faster sorting performance.

Then, you have an Update Request Processor (URP) chain and in it you
clone the field and choose the most appropriate value (smallest).
There are URPs for that, e.g.
http://www.solr-start.com/info/update-request-processors/#MinFieldValueUpdateProcessorFactory

Regards,
   Alex.
----
Solr Analyzers, Tokenizers, Filters, URPs and even a newsletter:
http://www.solr-start.com/


On 12 May 2015 at 16:22, nutchsolruser <nutchsolru...@gmail.com> wrote:
> Is there any way we can sort multivalued field in Solr. I have two documents
> with field custom_code and values are as below,
>
> Doc 1 : 11, 78, 45, 22
> Doc 2 : 56, 74, 62, 10
>
> When I sort it in ascending order the order should be ,
> Doc 2 : 56, 74, 62, 10
> Doc 1 : 11, 78, 45, 22
>
> Here Doc 2 will come first because it has smallest element 10 (which is
> greater that 11 of doc 1).
>
>
> How can we achieve this in Solr. What is the easiest way?
>
>
>
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Sorting-on-multivalues-field-in-Solr-tp4204996.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to