-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
No score calls if score is not requested #1646
Conversation
8815c69
to
af83975
Compare
src/query/weight.rs
Outdated
@@ -7,12 +7,21 @@ use crate::{DocId, Score, TERMINATED}; | |||
/// `DocSet` and push the scored documents to the collector. | |||
pub(crate) fn for_each_scorer<TScorer: Scorer + ?Sized>( | |||
scorer: &mut TScorer, | |||
requires_scoring: bool, |
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.
Can we not add this parameter to this function and instead create a separate function:
pub(crate) fn for_each_docset<TDocSet: DocSet + ?Sized>(
docset: &mut TDocset,
callback: &mut dyn FnMut(DocId)
) -> { ... }
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.
I updated the PR, but it still adds a fake score when collect()
ing
Codecov Report
@@ Coverage Diff @@
## main #1646 +/- ##
==========================================
+ Coverage 93.97% 94.04% +0.06%
==========================================
Files 253 255 +2
Lines 47716 48616 +900
==========================================
+ Hits 44843 45720 +877
- Misses 2873 2896 +23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
reader: &SegmentReader, | ||
callback: &mut dyn FnMut(DocId), | ||
) -> crate::Result<()> { | ||
let scorer = self.complex_scorer(reader, 1.0, &self.score_combiner_fn)?; |
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.
Does &DoNothingCombiner
make sense here?
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.
I think so, but it's not called anyway
Co-authored-by: Paul Masurel <[email protected]>
45f9e67
to
2af6b01
Compare
Those score calls can add add up in cost