[2.10] [MOD-11233] - fix: empty string token should be counted in byteOffset…#6972
Merged
[2.10] [MOD-11233] - fix: empty string token should be counted in byteOffset…#6972
Conversation
…s for highlighting (#6938) * initial commit * add newline at end of file * add debug prints * test: fix testing index being awaited * add test from the MOD-11233 * test: simplify tests to be easier to handle/debug * test: update test * test: improve test assertion * add test with some debug prints * fix: fix tokenization empty * remove useless field from tokenizer * fix: simpler fix * fix: improved behavior for forward index * fix spell check * change test name and var name * change test text * refactor: byteoffset handling independent * test: add more tests with highlighting and empty combination * apply changes as per code review --------- Co-authored-by: jonathan keinan <[email protected]> (cherry picked from commit 521847a)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.10 #6972 +/- ##
==========================================
- Coverage 89.32% 89.29% -0.03%
==========================================
Files 207 207
Lines 36165 36167 +2
==========================================
- Hits 32304 32297 -7
- Misses 3861 3870 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kei-nan
approved these changes
Oct 6, 2025
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.
Note
Ensure byte offsets are written for empty tokens to fix cross-field highlighting; update forward index token API and add highlight tests.
writeByteOffsetsinsrc/document.cto preserve correct cross-field highlighting.forwardIndexTokenFuncinto caller; computeindexesEmptynear token loop.forwardIndexTokenFuncsignature toint forwardIndexTokenFunc(ForwardIndexTokenizerCtx *tokCtx, const Token *tokInfo)and add detailed docs; remove internalallOffsetswrites.src/forward_index.hto match new signature.tests/pytests/test_highlight.pycovering highlighting across empty fields, arrays, field order,INDEXEMPTY, and empty-string queries.Written by Cursor Bugbot for commit 975346a. This will update automatically on new commits. Configure here.