-
-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(query): Make BooleanQuery
supports minimum_number_should_match
#2405
Conversation
…h`. see issue quickwit-oss#2398 In this commit, a novel scorer named DisjunctionScorer is introduced, which performs the union of inverted chains with the minimal required elements. BTW, it's implemented via a min-heap. Necessary modifications on `BooleanQuery` and `BooleanWeight` are performed as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very solid first PR! Good job. Please have a look at the comments.
@LebranceBW don't forget to reapply for review once you have added the requested changes |
1. More meaningful names. 2. Add Cache for `Disjunction`'s scorers, and fix bug. 3. Optimize `BooleanWeight::complex_scorer` Thanks Paul Masurel <paul@quickwit.io>
@fulmicoton I've done above requested changes, and |
@PSeitz can you help @LebranceBW and take over the code review? |
@PSeitz Could you help take a review for this PR? Thanks a lot. |
@PSeitz |
1 similar comment
@PSeitz |
@LebranceBW I left a comment to simplify the code regarding |
@PSeitz |
@PSeitz |
must_scorers = match must_scorers.take() { | ||
Some(mut must_scorers) => { | ||
must_scorers.append(&mut should_scorers); | ||
Some(must_scorers) | ||
} | ||
None => Some(should_scorers), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just create or append and not reassign the variable
Thanks @LebranceBW for the PR! |
👍🏻 |
see issue #2398
In this commit, a novel scorer named DisjunctionScorer is introduced, which performs the union of inverted chains with the minimal required elements. BTW, it's implemented via a min-heap. Necessary modifications on
BooleanQuery
andBooleanWeight
are performed as well.