You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2017/12/07 12:45:00 UTC

[06/50] [abbrv] lucene-solr:jira/solr-11285-sim: LUCENE-8074: Introduce leniency to work around scoringi accuracy issues caused by ReqOptSumScorer.

LUCENE-8074: Introduce leniency to work around scoringi accuracy issues caused by ReqOptSumScorer.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/faa77e92
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/faa77e92
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/faa77e92

Branch: refs/heads/jira/solr-11285-sim
Commit: faa77e92dd550f92456ea0050b9da6f364c670b6
Parents: 2ed0f1b
Author: Adrien Grand <jp...@gmail.com>
Authored: Mon Dec 4 10:14:35 2017 +0100
Committer: Adrien Grand <jp...@gmail.com>
Committed: Mon Dec 4 10:14:35 2017 +0100

----------------------------------------------------------------------
 .../apache/lucene/search/TestBooleanMinShouldMatch.java   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/faa77e92/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
index 26ce9c7..1d01f9a 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
@@ -380,7 +380,15 @@ public class TestBooleanMinShouldMatch extends LuceneTestCase {
                 + CheckHits.topdocsString(top1,0,0)
                 + CheckHits.topdocsString(top2,0,0)
                 + "for query:" + q.toString(),
-                score, otherScore, 0d);
+                score, otherScore,
+                // If there is at least one MUST/FILTER clause and if
+                // minShouldMatch is equal to the number of SHOULD clauses,
+                // then a query that was previously executed with
+                // ReqOptSumScorer is now executed with ConjunctionScorer.
+                // We need to introduce some leniency because ReqOptSumScorer
+                // casts intermediate values to floats before summing up again
+                // which hurts accuracy.
+                Math.ulp(score));
           }
         }