lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: Question: using boost for sorting
Date Wed, 16 Oct 2002 21:42:12 GMT
[I've moved this discussion to the developer list.]

David Birtwell wrote:
> I think this sounds like a great idea, too.
> It would be nice to modify the PhraseScorer and TermScorer to enable the 
> strict ordering.  I had to have the score() methods of these class 
> essentially ignore the base lucene scoring and just use the decoded norm 
> from Similarity.
> To enable this, Similarity could have a method like:
>    float applyNorm(float baseScore)
> which could optionally ignore baseScore and modify the scorer classes to 
> do:
>    score = applyNorm(score)
> instead of the
>    score *= Similarity.decodeNorms()

That would add a method call in the innermost search loop, which would 
probably have a noticeable performance impact.  (Similarity.decodeNorm() 
is a simple static method that JITs can trivially inline.)  Couldn't you 
achieve the same effect by overriding the normalizeLength() method 
and/or use Field.setBoost() to impact the value that is stored in the 
norm file?  That way this computation is performed  at index time rather 
than at search time.

If you need to be able to dynamically change the scoring method at 
search time then there will probably be a performance impact.  Ideally 
this should still be an option, however this would require opening up 
the scorer API, so that folks could define different scorer 
implementations for each Query class.  I'm not sure I yet want to take 
on that task, but if you have a proposal, I'd love to hear it.

> I'd be happy to contribute in this area if it would be helpful.

Please send diffs if you are interested in contributing.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message