You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by pris54 <in...@pris54.co.uk> on 2009/04/06 14:43:04 UTC

Custom sort based on arbitrary order

Hi, 

Apologies if this question has been answered already, I'm so new to Solr
(literally a few hours using it) that I still find some of the answers a bit
obscure.

I got Apache Solr working for a Drupal install, I must implement ASAP a
custom order that is fairly simple: there is a list of venues and some of
them are more relevant than others (there is no logic, it's arbitrary, it's
not an alphabetic order), it'd be something like this:

Orange venue = 1
Red venu = 2
Blue venue = 3

So results where venue is "orange" should go first, then "red" and finally
"blue". 
Could you advice on the easiest way to have this example working?

Thanks a lot,
Paula

-- 
View this message in context: http://www.nabble.com/Custom-sort-based-on-arbitrary-order-tp22908037p22908037.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Custom sort based on arbitrary order

Posted by Chris Hostetter <ho...@fucit.org>.
: custom order that is fairly simple: there is a list of venues and some of
: them are more relevant than others (there is no logic, it's arbitrary, it's
: not an alphabetic order), it'd be something like this:
: 
: Orange venue = 1
: Red venu = 2
: Blue venue = 3
: 
: So results where venue is "orange" should go first, then "red" and finally
: "blue". 
: Could you advice on the easiest way to have this example working?

use your rules to add values to all the docs at index time ... then sort 
on that value (ie: for each doc you actually index the value of 1, 2, or 3 
in a field no one ever looks at, but you sort on it.)



-Hoss