feat(search): include email notes in search results #512

Merged
guettlibot merged 1 commits from issue-488-search-notes into main 2026-06-06 23:58:24 +00:00
guettlibot commented 2026-06-06 23:58:16 +00:00 (Migrated from codeberg.org)

Summary

  • Extends searchEmailsGlobal and searchEmails to also search in email_notes.note_text via a JOIN on message_id/account_id
  • Adds a private _searchEmailsByNotes helper that runs a LIKE-based query and merges results with the existing FTS5 matches (deduplicating by email ID)
  • Updates the docstring for searchEmailsGlobal to mention notes

Test plan

  • Added searchEmailsGlobal includes emails matched by note text — verifies an email with no matching subject is returned when its note contains the query word
  • Added searchEmails includes emails matched by note text in mailbox — verifies mailbox filtering works for note-matched results (email in Sent does not appear in INBOX search)
  • Existing FTS5 search tests remain green

Closes #488

🤖 Generated with Claude Code

## Summary - Extends `searchEmailsGlobal` and `searchEmails` to also search in `email_notes.note_text` via a JOIN on `message_id`/`account_id` - Adds a private `_searchEmailsByNotes` helper that runs a `LIKE`-based query and merges results with the existing FTS5 matches (deduplicating by email ID) - Updates the docstring for `searchEmailsGlobal` to mention notes ## Test plan - [x] Added `searchEmailsGlobal includes emails matched by note text` — verifies an email with no matching subject is returned when its note contains the query word - [x] Added `searchEmails includes emails matched by note text in mailbox` — verifies mailbox filtering works for note-matched results (email in Sent does not appear in INBOX search) - [x] Existing FTS5 search tests remain green Closes #488 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.