apache / apache/lucene

BooleanScorer/2 should not call .score() on MUST_NOT clauses [LUCENE-4395]

Open
#5,461 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

In working on #5432 I realized we are doing this today (and then Robert reminded me BS2 is also doing it), which is really quite silly.

Seems like a fast fix would be to wrap such clauses in ConstantScoreQuery ... but further improvements are possible with BooleanScorer:

- Don't add the bucket to the valid list

- If the current clause is not prohibited, but this document was already marked prohibited from a previous clause, then do not call score (BS2 could do this as well)

I don't think I'll have near-term time to dig on this so feel free to take it if you are inspired!

---
Migrated from [LUCENE-4395](https://issues.apache.org/jira/browse/LUCENE-4395) by Michael McCandless (@mikemccand)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.