Repository navigation
fix: preserve dotted identifiers in BM25 retrieval - #2336
Merged
pancacake merged 3 commits intoNov 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Description
BM25's default tokenizer loses dotted exercise/section identifiers and single-character terms. Use one shared token pattern for corpus and queries across regular, scoped, and legacy page retrieval, including the direct bm25s fallback. Identifiers such as
2.6.8remain intact even next to Chinese text; existing English stopword filtering still applies.Record the pattern with persisted BM25 sidecars and restore it when loading. Rebuild older or incompatible caches from stored documents without new embeddings. A bounded cache reuses rebuilds for a loaded index/result count, and loading an updated index invalidates that reuse.
Related Issues
Module(s) Affected
servicestestsdocsValidation
On macOS arm64 with standalone CPython 3.12.14 and Redis 7.4:
python -m pytest -q tests deeptutor/learning/tests: 12,257 passed, 43 skipped, 31 subtests passed.python -m pytest tests/services/rag -q: 980 passed, 1 skipped.pre-commit run --all-files --show-diff-on-failure: all hooks passed.uv pip check: all 281 installed packages compatible.The BM25 regressions use synthetic documents and mock embeddings. The upstream Python/OS CI matrix remains to run.
Checklist
devpre-commit run --all-filesand fixed any issues.