lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcb <>
Subject Using a function for sort
Date Sat, 27 Aug 2011 18:05:08 GMT
Hi there, 
Relatively new solr user with an unfortunately not-so-newb question. I'm
trying to create a function that I can use as the sort field that compares
what fields match. So basically, say I have a database of cars and I want to
simply select all of them (the sort shouldn't remove any results), I'm just
going to write:


Then I want to return a number between 0 and 1 based on 3 fields: Color,
Type, and Transmission. So the function basically says: 

*If Color=Red, add .25 to the result
If Type=SUV, add .5 to the result
if Transmission=Auto, add .25 to the result*

A match on all fields returns *1*, a match on the 1 and 3 only returns *.5*,

I think the following approach I have might be a step in the right


but not sure if tf is really the best too to use for this, thanks for the

View this message in context:
Sent from the Lucene - General mailing list archive at

View raw message