Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 99762 invoked from network); 1 May 2009 22:00:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 May 2009 22:00:05 -0000 Received: (qmail 43894 invoked by uid 500); 1 May 2009 22:00:02 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 43836 invoked by uid 500); 1 May 2009 22:00:02 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 43826 invoked by uid 99); 1 May 2009 22:00:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 22:00:02 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.69.42.181] (HELO radix.cryptio.net) (208.69.42.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 21:59:54 +0000 Received: by radix.cryptio.net (Postfix, from userid 1007) id 6780D71C413; Fri, 1 May 2009 14:59:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by radix.cryptio.net (Postfix) with ESMTP id 64F7F71C411 for ; Fri, 1 May 2009 14:59:33 -0700 (PDT) Date: Fri, 1 May 2009 14:59:33 -0700 (PDT) From: Chris Hostetter To: java-user@lucene.apache.org Subject: Re: lucene score and float precision In-Reply-To: <4655F93B69E345CB9B187A7C5C09AC6A@perazin> Message-ID: References: <4655F93B69E345CB9B187A7C5C09AC6A@perazin> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : 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