Skip to content

feat(search): very basic email multi term#1951

Merged
gbirman merged 10 commits intomainfrom
gab/feat/multi-term-search-email
Mar 13, 2026
Merged

feat(search): very basic email multi term#1951
gbirman merged 10 commits intomainfrom
gab/feat/multi-term-search-email

Conversation

@gbirman
Copy link
Copy Markdown
Contributor

@gbirman gbirman commented Mar 13, 2026

Email now supports multi term search similar to gmail's api (not exactly there but better than before). This is by default an AND operation over various fields of the email body. Mismatches with gmail's api, like fuzziness, stopword removal, attachment indexing still exist, but we can improve on the algorithm later once we have this basic version.

In order to do this, I deprecate terms field in the serach service request in favor of a single query, so that the backend handles the terms splitting, with double quotes wrapping a term. So for non-email indices, this will operate the same as before with or without double quotes. For emails, if there's a single term it will operate as before (splitting content search in opensearch and subject serach in postgres), and if there's multiple terms it will try to do everything in opensearch so we can take advantage of the multi-term AND logic that doesn't require a difficult joining across different sources of truth. Email messages also benefit from having all their content indexed as a single opensearch entry, whereas markdown docs are currently stored with separate entries per paragraph (node id).

there's a lot more to be done here but this will come in a future pr

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 13, 2026

@gbirman gbirman changed the title feat(search): email multi term feat(search): very basic email multi term Mar 13, 2026
@gbirman gbirman merged commit 0c01e64 into main Mar 13, 2026
39 checks passed
@gbirman gbirman deleted the gab/feat/multi-term-search-email branch March 13, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant