Repository navigation
Document the two tsvector limits on term frequency - #85
Merged
Merged
Conversation
A position is 16 bits and a lexeme stores at most 255 positions per document, so a document past 16,383 indexed tokens has its later positions clamped and a term repeated more than 255 times has its frequency capped. FiQA has such a document for 'over'; the vocabulary and document frequencies are unaffected and BM25's saturation makes the effect small, but the cap is stated rather than discovered.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
=======================================
Coverage 89.18% 89.18%
=======================================
Files 271 271
Lines 21461 21461
Branches 4635 4635
=======================================
Hits 19141 19141
Misses 1388 1388
Partials 932 932 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Two limits of the
tsvectorcolumn the BM25 engine stores, stated on the backend page:Both apply to the Database analysis and to any client-side vector, because they are properties of the
tsvectortype. No corpus measured here approaches the position bound, but FiQA has a document whereoveroccurs more than 255 times: itstfis capped there, the vocabulary and document frequencies are unaffected, and BM25's saturation makes the score effect small. Where the in-memory scorer sees atfpast 255, this engine does not.Measured on the test server:
nentryforrepeat('x ', 300)is 255, and the maximum position in a 17,000-token document is 16,383. Docs only, no code change.