lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rachun <rachun.c...@gmail.com>
Subject Customise score
Date Wed, 02 Jul 2014 15:02:22 GMT
Dear all,

Could anybody suggest me how to customize the score?
So, I have data like this ..

{ID : '0001', Title :'MacBookPro',Price: 400,Base_score:'121.2'}
{ID : '0002', Title :'MacBook',Price: 350,Base_score:'100.2'}
{ID : '0003', Title :'Laptop',Price: 300,Base_score:'155.7'}

Notice that I have ID field for uniqueKey.
When I query q=MacBook & sort=score desc
it will return result something like this

{ID : '0002', Title :'MacBook',Price: 350,Base_score:'100.2',score:1.45}
{ID : '0001', Title :'MacBookPro',Price: 400,Base_score:'121.2',score:1.11}

But I want solr to produce score by also using my Base_score. The score
should be something like this

- score = 100.2 + 1.45 = 101.65
- score = 121.2 + 1.11 = 122.31

Then the result should be something like this..

{ID : '0001', Title :'MacBookPro',Price:
400,Base_score:'121.2',score:122.31}
{ID : '0002', Title :'MacBook',Price: 350,Base_score:'100.2',score:101.65}

I'm not familia with Java so I can't write my own function as somebody do.
So, which is the easiest way to do this work using existing function from
solr?

Thank you very much,
Chun.




--
View this message in context: http://lucene.472066.n3.nabble.com/Customise-score-tp4145214.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message