Skip to content

Add weighted BM25 ordering for FTS5 queries - #1378

Open
GtechGovind wants to merge 1 commit into
stephencelis:masterfrom
GtechGovind:fix/fts5-weighted-ranking
Open

GtechGovind wants to merge 1 commit into
stephencelis:masterfrom
GtechGovind:fix/fts5-weighted-ranking

Conversation

@GtechGovind

@GtechGovind GtechGovind commented Sep 22, 2026 •

Copy link
Copy Markdown

Summary

I added a typed VirtualTable.bm25(_:) expression so FTS5 results can be ordered by weighted relevance. The weights follow the virtual table column order, and omitted weights use SQLite FTS5 defaults. I documented usage and added SQL-generation and live FTS5 regression tests that show changing weights reverses result order.

Closes #1016.

Validation

  • FTS5-enabled XCTest bundle: 502 tests passed, 0 skipped.
  • Default SQLite XCTest bundle: 502 tests passed, 4 FTS5 integration tests skipped as expected.
  • Strict SwiftLint without SourceKit: passed; SourceKit-dependent statement_position was skipped. The standard lint target could not load SourceKit on this machine because the installed Xcode license is not accepted.

@GtechGovind
GtechGovind marked this pull request as ready for review October 2, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add column weights to FTS order by Rank

1 participant