lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: Normalized Scoring
Date Wed, 20 Oct 2004 17:40:28 GMT

Hits normalizes the final highest score to 1.0, and you
can mplement your own HitCollector to suppress
that normalisation. 

For the rest have a look at Weight, it can easily be used
for your example by having sumOfSquaredWeights()
return some sum of the weights, and letting normalize()
do the divisions into the weights of the individual TermQuery's.

Many Lucene queries implement their Weight in an inner class.
It is used as an interim step to get from a Query to a Scorer.

Kind regards,
Paul Elschot

On Wednesday 20 October 2004 07:56, Chuck Williams wrote:
> As an example of the simple boost-based normalization, for the query
>   ((a^2 b)^3 (c d^2))
> the net boosts are:
>   a --> 6
>   b --> 3
>   c --> 1
>   d --> 2
> So if a and b matched, but not c and d, in the top scoring result, its
> score would be 0.75.  The normalizer would be 0.75/(current score except
> for the current normalization).  This normalizer would be applied to all
> current scores (minus normalization) to create the normalized scores.
> For simple query (a b), if only one of the terms matched in the top
> result, then its score would be 0.5, vs. 1.0 or many other possible
> scores today.

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

View raw message