mirror of
https://github.com/bitbaum/solon.git
synced 2026-12-04 11:07:09 +01:00
* feat(places): find a place with a letter wrong (searchkit)
The map's search box matched a name only if the folded text appeared in it
exactly, and the name search behind /places, /compare and /api/v1/places was
an ILIKE on the same folded text. One slipped letter ("Zurihc", "Kusnaht")
found nothing, and "st gallen" missed "St. Gallen" for want of the dot.
Both now go through @bitbaum/searchkit, the fleet's shared search package:
- Map box (in the browser): the hand-rolled startsWith/includes matcher in
map-view.ts is replaced by an index built once per map (`placeFinder`):
typo budget by word length, prefixes while typing, accents and umlauts
folded, Algolia-order ranking. The list marks the matched part of each
name, styled like OrangeCat's palette marks.
- Name search (database): the folded LIKE stays for recall, widened per
typed word by the names' own words that word is one slip from (a
vocabulary read once per 10 minutes per process), with a word no name
comes near set aside instead of failing the search. What comes back is
ordered by searchkit's rerank instead of the exact/prefix/contains sort.
Postcodes are an exact lookup and stay one.
fold.ts keeps its SQL fold table: the database side still needs the query
and the column folded alike. Tests: every one-slip misspelling of every
place name in the Swiss fixtures (2,627 cases) is found first by the map
box; through the database, 276 cases are all in the top three and all but
one first ("vern" reads as the start of "Verwaltungskreis" before Bern).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf
* chore(deps): add @bitbaum/searchkit, pinned to orangecat a868c0a9
The fleet's one search package, installed from orangecat by commit
(packages/searchkit). It ships compiled dist/, so no transpile step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf
* docs(changelog): link the place-search entry to #264
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf
---------
Co-authored-by: Claude <noreply@anthropic.com>