feat(search): weighted FTS ranking + searchable message bodies#294
Open
salmonumbrella wants to merge 1 commit into
Open
feat(search): weighted FTS ranking + searchable message bodies#294salmonumbrella wants to merge 1 commit into
salmonumbrella wants to merge 1 commit into
Conversation
Results ranked by relevance instead of date-only: subject > sender > body (setweight A-D + ts_rank_cd), prefix matching as you type, quoted phrases, served by a GIN index over a trigger-maintained search_fts column. Backfill runs as a resumable background drainer (fast-DDL migrations 0035-0037, no boot-blocking rewrite); not-yet-backfilled rows fall back to the previous query path. Body text is materialized by a provider-gated background IMAP drainer with circuit breakers, poison-message forward progress, and progress reporting. Filter-only queries stay date-ordered. No infrastructure changes - runs on stock postgres:16-alpine. Split 1/3 of maathimself#283. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Split 1/3 of #283, per the review request there. Keyword-search improvements only — no infrastructure changes, no new dependencies, runs on stock
postgres:16-alpine.Summary
Search results are ranked by relevance instead of date-only, and message bodies become searchable across the whole mailbox.
setweightA–D +ts_rank_cd), prefix matching as you type, quoted phrases, served by a GIN index over a trigger-maintainedsearch_ftscolumn. Filter-only queries stay date-ordered.search_ftsfills via a background drainer, and not-yet-backfilled rows fall back to the previous query path. The legacysearch_vectorcolumn stays until a follow-up removes it once backfill completes on real installs.body_text(apple/yahoo/generic on; Gmail/PurelyMail/Microsoft off given their throttle history), with circuit breakers, poison-message forward progress, andbackground_jobsprogress rows.mode: 'lexical'field — the stable contract the semantic follow-up PR extends with real modes.Rebased on current main; resolves the
imapManager.test.jsoverlap with the recent IMAP connect-backoff change by keeping both test groups.The split is a re-partition, not a rewrite: with all three split PRs applied, the tree is byte-identical to the reviewed #283 head (
3773150).Testing
--max-warnings 0)Contributor License Agreement
By submitting this pull request I confirm that:
🤖 Generated with Claude Code