Skip to content

fix: strip email domains from FTS search input - #140

Open
c1-dev-bot[bot] wants to merge 1 commit into
mainfrom
fix/email-search-strip-domain
Open

fix: strip email domains from FTS search input#140
c1-dev-bot[bot] wants to merge 1 commit into
mainfrom
fix/email-search-strip-domain

Conversation

@c1-dev-bot

@c1-dev-bot c1-dev-bot Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When users search the Task Log by full email address (e.g. dluu@zscaler.com), FullTextSearchQuery produces tokens like dluu and zscalercom (domain with dot stripped). Since the FTS index only contains display name tokens, the domain token never matches, causing 0 results.
  • Adds stripEmailDomains() preprocessing that detects email-format tokens in the search input and extracts only the local-part before @, so dluu@zscaler.com becomes dluu before tokenization.
  • Includes unit tests for stripEmailDomains and an integration test (TestSearchEmailAddress) verifying email search matches against display name vectors.

Fixes: IGA-1508

Test plan

  • TestStripEmailDomains — verifies email domain stripping for various inputs (single email, multiple emails, non-email text, edge cases like @orphan, empty strings)
  • TestSearchEmailAddress — integration test against Postgres confirming that dluu@zscaler.com matches a vector containing dluu while notauser@example.com does not
  • Existing FTS tests pass unchanged (no regression in symbol, dot, camel, snake, path, prefix matching)

Automated PR Notice

This PR was automatically created by c1-dev-bot as a potential implementation.

This code requires:

  • Human review of the implementation approach
  • Manual testing to verify correctness
  • Approval from the appropriate team before merging

When users search by full email address (e.g. user@domain.com), the
jargon tokenizer splits at '@' producing domain tokens that never exist
in the FTS index (which only indexes display names). This causes 0
results for email searches.

Add stripEmailDomains() preprocessing to extract only the local-part
before '@', so "user@domain.com" becomes "user" before tokenization.

Fixes: IGA-1508
@linear

linear Bot commented Apr 22, 2026

Copy link
Copy Markdown

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.

0 participants