-
-
Notifications
You must be signed in to change notification settings - Fork 840
Added seek_doc to weight #2785
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
base: main
Are you sure you want to change the base?
Added seek_doc to weight #2785
Conversation
3bc26fa to
4800401
Compare
eac4c95 to
1898828
Compare
20ef4f2 to
f98ba14
Compare
tantivy requires Scorer to be positioned on a DocId at all time. This decision is not performance neutral. When we have an intersection of a heavy DocSet with a lighter one forcing the positioning of the first doc is needlessly expensive. This PR fixes this by introducing a seek_doc parameter in the weight function. Weights may skip over documents when they create the Scorer.
f98ba14 to
98be1a5
Compare
d954b74 to
601541e
Compare
| } | ||
|
|
||
| /// Returns a priority number used to sort weights when running an | ||
| /// intersection. |
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.
We should add a comment here what higher or lower numbers mean
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.
yes. Added a comment.
b3db43b to
d210a30
Compare
d210a30 to
a5dc888
Compare
| /// Creates a Segment Postings from a | ||
| /// - `BlockSegmentPostings`, | ||
| /// - a position reader | ||
| /// - a target document to seek to |
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.
| /// - a target document to seek to | |
| /// - a target document to seek to within the passed block |
not sure if that's correct (the comment and variable name don't match)
| let Some(term_info) = self.get_term_info(term)? else { | ||
| return Ok(None); | ||
| }; | ||
| let block_postings_not_loaded = |
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.
| let block_postings_not_loaded = | |
| let block_postings = |
PSeitz
left a comment
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.
left some comments
No description provided.