开发者

Boosting documents in Solr based on the vote count

I have a field in my schema which holds the number of votes a document has. How can I boost documents based on that number?

Something like the one which has the maximum number has a boost of 10, the one with the smallest number has 0.5 and in between the values get calculated automatically.

What I do now i开发者_Python百科s this, but it doesn't give the desired results:

recip(rord(vote_count),1,1000,1000)^10.0

Thanks.


i tend to build my indexes using raw lucene, in which case it is extremely easy,

doc.setBoost(boost_val);


I'm just starting on this and it looks like either a linear boost or log based boost will help most: i.e. log(votecount)^10 (don't forget ^10 means boost times 10, not to the tenth power.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜