Fix BM25 field weights to include all 3 FTS columns#462
Merged
Conversation
The bm25() call only had 2 weights for 3 columns (filepath, title, body), giving body an implicit weight of 0. Add proper weights: filepath=1.5, title=4.0, body=1.0 so title matches are boosted and body content is scored.
zeattacker
pushed a commit
to zeattacker/qmd
that referenced
this pull request
Mar 26, 2026
body column was getting weight 0, making body-only matches invisible. Cherry-picked from tobi#462 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jaylfc
added a commit
to jaylfc/qmd
that referenced
this pull request
Apr 5, 2026
Fix BM25 field weights to include all 3 FTS columns
jaylfc
added a commit
to jaylfc/qmd
that referenced
this pull request
Apr 5, 2026
Fix BM25 field weights to include all 3 FTS columns
tanarchytan
referenced
this pull request
in tanarchytan/lotl
Apr 8, 2026
Fix BM25 field weights to include all 3 FTS columns
tanarchytan
referenced
this pull request
in tanarchytan/lotl
Apr 8, 2026
Resolve conflict: use CTE approach from #455 with updated BM25 weights (1.5, 4.0, 1.0) from #462. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lucndm
pushed a commit
to lucndm/qmd
that referenced
this pull request
Jun 7, 2026
Fix BM25 field weights to include all 3 FTS columns
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.
Summary
bm25()call only specified 2 weights for 3 FTS5 columns (filepath,title,body), which meant thebodycolumn implicitly received weight 0bm25(documents_fts, 10.0, 1.0)tobm25(documents_fts, 1.5, 4.0, 1.0)— title gets 4x weight, filepath gets 1.5x, body gets 1.0Test plan
test/eval-bm25.test.ts)