-
-
Notifications
You must be signed in to change notification settings - Fork 838
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
| /// | ||
| /// You can either call `load_at_start` to load it its first block, | ||
| /// or skip a few blocks by calling `seek_and_load`. | ||
| pub(crate) struct BlockSegmentPostingsNotLoaded(BlockSegmentPostings); |
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't we require the docid seek on the BlockSegmentPostings instead and drop this intermediate struct?
No description provided.