feat(search): fuzzy/typo tolerance (pg_trgm) #16

Merged
cesnimda merged 1 commits from feature/search-fuzzy into develop 2026-07-01 22:45:11 +02:00

1 Commits

Author SHA1 Message Date
cesnimda c3f53eb470 feat(search): fuzzy/typo tolerance fallback (pg_trgm word_similarity)
CI / backend (pull_request) Successful in 50s
CI / frontend (pull_request) Successful in 14s
Security / secrets (pull_request) Successful in 5s
Security / dependencies (pull_request) Successful in 54s
Slice 4 of search-core: when an exact free-text search returns zero results, fall
back to pg_trgm word_similarity on the subject (explicit 0.3 threshold — pg_trgm's
default 0.6 misses real typos like 'recieved'->'received' ~0.39). Fallback-only, so
it never dilutes good exact matches; fuzzy hits get no ts_headline. Migration enables
the pg_trgm extension (CREATE EXTENSION IF NOT EXISTS — idempotent).

Also relocates the EmailSummaryDto.MatchHighlight note to an XML doc: a comment inside
the record's parameter list was tripping dotnet-format's whitespace check on every
commit (mutating format wouldn't fix it) — moving it out clears that drift for good.

Verified end-to-end vs a live Postgres via throwaway test (removed): typo 'recieved'
fuzzy-matched a subject with 'received'. Build + all 40 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 22:41:42 +02:00