Robert Muir created LUCENE-8024: ----------------------------------- Summary: Remove unnecessary norms.advanceExact check in score() Key: LUCENE-8024 URL: https://issues.apache.org/jira/browse/LUCENE-8024 Project: Lucene - Core Issue Type: Bug Reporter: Robert Muir
This should no longer be needed, since the index-time boost is removed, and since sims are no longer asked to score non-existent terms. E.g. core tests pass with: {noformat} --- a/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java +++ b/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java @@ -230,11 +230,8 @@ public class BM25Similarity extends Similarity { if (norms == null) { norm = k1; } else { - if (norms.advanceExact(doc)) { - norm = cache[((byte) norms.longValue()) & 0xFF]; - } else { - norm = cache[0]; - } + norms.advanceExact(doc); + norm = cache[((byte) norms.longValue()) & 0xFF]; } return weightValue * (float) (freq / (freq + norm)); } {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org