Sorting on multi-valued field

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Sorting on multi-valued field

Peri Subrahmanya
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 | Threaded
Open this post in threaded view
|

Re: Sorting on multi-valued field

iNikkz
Hi Peri,
              You cannot do sort on multi-valued field. It should be set to
false.

On Tue, Feb 24, 2015 at 8:07 PM, Peri Subrahmanya <
[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: Sorting on multi-valued field

Mikhail Khludnev
fwiw,

open solr jira https://issues.apache.org/jira/browse/SOLR-2522 pls vote
however, everything seems done at lucene level
https://issues.apache.org/jira/browse/LUCENE-5454


On Tue, Feb 24, 2015 at 6:11 PM, Nitin Solanki <[hidden email]> wrote:

> Hi Peri,
>               You cannot do sort on multi-valued field. It should be set to
> false.
>
> On Tue, Feb 24, 2015 at 8:07 PM, Peri Subrahmanya <
> [hidden email]> 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.
> >
> >
> >
>



--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Sorting on multi-valued field

Alexandre Rafalovitch
In reply to this post by Peri Subrahmanya
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
<[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: Sorting on multi-valued field

sjhyam
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 <[hidden email]> 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
> <[hidden email]> 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.
>>
>>