You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Mike Tinnes <ti...@ecliptictech.com> on 2002/07/23 19:38:32 UTC

Modifying scores

I'm trying to implement a HITS/PageRank type algorithm and need to modify
the document scores after a search is performed. The final score will be a
combination of the lucene score and PageRank. Is there currently a way to
modify the scores on the fly via HitCollector? so that calling the
Hits.score() function will return my combined score?

Thanks, Mike



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Modifying scores

Posted by Doug Cutting <cu...@lucene.com>.
Mike Tinnes wrote:
> I'm trying to implement a HITS/PageRank type algorithm and need to modify
> the document scores after a search is performed. The final score will be a
> combination of the lucene score and PageRank. Is there currently a way to
> modify the scores on the fly via HitCollector? so that calling the
> Hits.score() function will return my combined score?

There's currently no API that supports this well.  The best approach at 
present would be to define a HitCollector which multiplies your PageRank 
factor into the score and collects the top-scoring hits.  (The Hits 
class does not use the HitCollector API, so you can't use it when you're 
using a HitCollector.)

Longer term, we plan to add a Document.setBoost(float) method.  The 
number supplied here will be multiplied into scores for hits on the 
document.  There will also be a Field.setBoost(float).  Both boosts will 
default to 1.0.  I'm hoping to start implementing this soon.  If you're 
interested in helping with the implementation, or have more ideas about 
this, please send a message to the lucene-dev list.

Cheers,

Doug



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>