Files
CatoandClaude c519d389b9 feat(search): every word in any order, accents folded, best match first (v0.2.0) (#3)
v0.1 matched the whole query as one substring and sorted matches like
any other row. Three ways that failed people:
- word order: "bike sell" did not find "Sell my old bike";
- accents: "zurich" did not find "Zürich", "strasse" not "Straße";
- ranking: a title hit and a hit deep in a description sorted alike.

Now (src/search.ts):
- searchMatches: every folded word must appear in some field;
- normalise: NFKD, marks stripped, ß→ss, casefold, collapse spaces;
- searchScore: field position (most important first) × match quality
  (whole field > field start > word start > inside), plus a phrase bonus;
- applyQuery ranks by score while a search is active and the sort is the
  default; ties keep the default order; a chosen sort wins;
  `?sort=relevance` asks explicitly; `search.rank: false` opts out;
- searchTerms(q) so SQL builders AND one likeContains per word.

Filtering only widens (no previous match is lost), so this is a minor
bump. 9 new tests; verify green.


Claude-Session: https://claude.ai/code/session_01TAtbutb1k6VKYMPLVfSt92

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-03 03:40:02 -07:00
..
2026-09-11 17:17:16 +02:00
2026-09-11 17:17:16 +02:00
2026-09-11 17:17:16 +02:00