How about creating two fields for the multi-valued field. First, grab the 
higher and lower values of the multi-valued field by using natural sort order. 
Then use the first field to store the highest order value. Use second field to 
store lowest order value. Both these fields are single valued.

Now based on the sort order of the original field, override the sort field in 
the handler side before executing the query.

Thanks 
Shyamsunder
Sent from my iPhone

> On Feb 24, 2015, at 11:28 AM, Alexandre Rafalovitch <arafa...@gmail.com> 
> wrote:
> 
> The usual strategy is to have an UpdateRequestProcessor chain that
> will copy the field and keep only one value from it, specifically for
> sort. There is a whole collection of URPs to help you choose which
> value to keep, as well as how to provide a default.
> 
> You can see the full list at:
> http://www.solr-start.com/info/update-request-processors/#FieldValueSubsetUpdateProcessorFactory
> 
> Also, if you are on the recent Solr, consider enabling docValues on
> that target single-value field, it's better for sorting. You can have
> other flags (stored,indexed) set to false, as you will not be using
> the field for anything else.
> 
> Regards,
>    Alex.
> ----
> Solr Analyzers, Tokenizers, Filters, URPs and even a newsletter:
> http://www.solr-start.com/
> 
> 
> On 24 February 2015 at 09:37, Peri Subrahmanya
> <peri.subrahma...@htcinc.com> wrote:
>> All,
>> 
>> Is there a way sorting can work on a multi-valued field or does it always 
>> have to be “false” for it to work.
>> 
>> Thanks
>> -Peri
>> 
>> *** DISCLAIMER *** This is a PRIVATE message. If you are not the intended 
>> recipient, please delete without copying and kindly advise us by e-mail of 
>> the mistake in delivery.
>> NOTE: Regardless of content, this e-mail shall not operate to bind HTC 
>> Global Services to any order or other contract unless pursuant to explicit 
>> written agreement or government initiative expressly permitting the use of 
>> e-mail for such purpose.
>> 
>> 

Reply via email to