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

This commit is contained in:
Adrien Grand 2017-12-04 10:14:35 +01:00
parent 2ed0f1b68e
commit faa77e92dd
1 changed files with 9 additions and 1 deletions

View File

@ -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));
}
}