lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Question about SOLR custom sort order
Date Sun, 01 Jan 2012 16:09:54 GMT
There's no good way of enforcing this as far as I know
as you've outlined the problem. You can easily specify
multiple sort criteria, where ties in the first criteria
are broken by the second criteria and so on.

So, if your records have *no* city value you can do what
you want by specifying the city field to sortMissingLast
then specifying state as your second criteria.

So you can probably do what you want by breaking
up your location field into fields that are specific
for sorting (probably use copyfield here?) and specifying
as above.


Best
Erick

On Sun, Jan 1, 2012 at 3:19 AM, Gupta, Veeranjaneya
<Veeranjaneya.Gupta@travelocity.com> wrote:
> Hi,
>
> I use Solr 1.4 version and I have a question about SOLR sort order.
> Requirement : Sort  names(e.g. : location names like Dallas(City), las vegas(City),
Texas(State), India(Country), Canada(Country), etc..) based on category(e.g. : CITY, STATE,
COUNTRY, etc..)
> How to sort the SOLR results based on custom order?
> Expected result :
>
> 1.       Dallas
>
> 2.       Las Vegas
>
> 3.       Texas
>
> 4.       Canada
>
> 5.       India
>
> Thanks & Regards, Gupta

Mime
View raw message