chore: evaluate Fuse.js to replace custom fuzzy search implementation
Summary
src/utils/searchUtils.ts contains a hand-rolled Levenshtein distance algorithm
with a weighted scoring system (exact: 100, substring: 60, fuzzy: 40). This works
for current dataset sizes but carries maintenance burden and edge-case risk.
Candidate Library
Fuse.js — https://www.fusejs.io/
- ~4KB gzipped
- Apache-2.0 license
- Battle-tested fuzzy search with ranking
- Configurable thresholds and key weights
Action
Benchmark Fuse.js against the current implementation on the actual patient/doctor
datasets. If relevance quality is equal or better, replace searchUtils.ts (~47 lines)
with a thin wrapper around Fuse.js.
If datasets remain small (<500 items) and current results are acceptable, close this issue and document the tradeoff in a code comment.
Acceptance Criteria
-
Benchmark run on real data -
Decision documented (replace or keep with comment)
Labels: chore, dependencies, performance