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 Chris Hostetter <ho...@fucit.org> on 2009/05/01 23:59:33 UTC

Re: lucene score and float precision

: in some cases we have the problem that for a document the ScoreDoc score
: differs at the last digit of the float from the score reported by the
: explanation functionality of lucene. For example: 
: 
: ScoreDoc: 16.770466 -- Explanation: 16.770468 = (MATCH) sum of: ...
: ScoreDoc: 21.118656 -- Explanation: 21.118654 = (MATCH) sum of: ...
: 
: The explanation function reports a score as expected, compared to the other
: results of the search, while the ScoreDoc score is a bit to low or to high. 
: 
: Does anyone have an idea? 

The nature of an Explanation object is that it gets built up using a code 
path that keeps track of all the intermediate values while computing a 
score for a single document, while the actaul score is typically generated 
using a differnet code path that can be optimized for speed.  the 
different code paths might be mathematicly equivilent, but if the order of 
operations is different, floating point truncation errors could result in 
slightly differnet scores (ie: "(a/b)*c" is in theory equal to "(a*c)/b" 
but in practice minor iscrepencies can be introduced)

This is why the tests for Excplanations use CheckHits.EXPLAIN_SCORE_TOLERANCE_DELTA



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org