mirror of https://github.com/apache/lucene.git
LUCENE-3487: use a relative delta for comparing BS2 vs BS2 with minShouldMatch
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1181474 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d526a4c699
commit
51c1a461a8
|
@ -313,7 +313,9 @@ public class CheckHits {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static float explainToleranceDelta(float f1, float f2) {
|
/** returns a reasonable epsilon for comparing two floats,
|
||||||
|
* where minor differences are acceptable such as score vs. explain */
|
||||||
|
public static float explainToleranceDelta(float f1, float f2) {
|
||||||
return Math.max(EXPLAIN_SCORE_TOLERANCE_MINIMUM, Math.max(Math.abs(f1), Math.abs(f2)) * EXPLAIN_SCORE_TOLERANCE_DELTA);
|
return Math.max(EXPLAIN_SCORE_TOLERANCE_MINIMUM, Math.max(Math.abs(f1), Math.abs(f2)) * EXPLAIN_SCORE_TOLERANCE_DELTA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -359,7 +359,7 @@ public class TestBooleanMinShouldMatch extends LuceneTestCase {
|
||||||
+ CheckHits.topdocsString(top1,0,0)
|
+ CheckHits.topdocsString(top1,0,0)
|
||||||
+ CheckHits.topdocsString(top2,0,0)
|
+ CheckHits.topdocsString(top2,0,0)
|
||||||
+ "for query:" + q2.toString(),
|
+ "for query:" + q2.toString(),
|
||||||
score, otherScore, 1.0e-6f);
|
score, otherScore, CheckHits.explainToleranceDelta(score, otherScore));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue