mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-06-19 09:16:45 +00:00
explain why naive scorer must accumulate scores in WAND order
This commit is contained in:
parent
2a82dd6f64
commit
f451fa938f
1 changed files with 4 additions and 0 deletions
|
|
@ -273,6 +273,10 @@ mod tests {
|
|||
}
|
||||
|
||||
if all_match {
|
||||
// Accumulate in the same left-to-right order as the WAND implementation
|
||||
// (leader first, then each secondary in turn). Float addition is not
|
||||
// associative, so `leader + secondaries.sum()` gives a different bit
|
||||
// pattern and can cause spurious nearly_equals failures.
|
||||
let mut score: Score = leader.score();
|
||||
for secondary in secondaries.iter_mut() {
|
||||
score += secondary.score();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue