Search over folded names: one Go matcher for the page (wasm) and the service, and a sharded static index #77

Closed
opened 2026-10-28 15:06:00 +00:00 by hum3 · 1 comment
Owner

Search today is a stand-in twice over: the front page filters the list in the page with JavaScript substring matching (#76), and GET /people?q= matches case-insensitively. Neither handles the names of twenty billion people in many scripts, and neither scales past the list in the page.

What scales is the index, and the reason to use wasm is one matcher in both places.

  1. A names package: the search form of a name (Unicode normalisation, marks stripped, case folded, letters like ø æ ß ł unified, Han characters as words of their own, Arabic alef forms unified, punctuation dropped) and the match (every word of the folded query is a prefix of a word of the folded name). Pinned by fixtures in Latin, Cyrillic, Greek, Arabic and Chinese.
  2. The service's GET /people?q= and the front page's search (via the existing wasm) both use it.
  3. The static site ships a sharded index by folded prefix, names/<prefix>.json, fetched on demand, so a sandbox of millions searches without a server; the folded form is the key a database (#7, #11) indexes later.

Towards #10.

Search today is a stand-in twice over: the front page filters the list in the page with JavaScript substring matching (#76), and `GET /people?q=` matches case-insensitively. Neither handles the names of twenty billion people in many scripts, and neither scales past the list in the page. What scales is the index, and the reason to use wasm is one matcher in both places. 1. A `names` package: the search form of a name (Unicode normalisation, marks stripped, case folded, letters like ø æ ß ł unified, Han characters as words of their own, Arabic alef forms unified, punctuation dropped) and the match (every word of the folded query is a prefix of a word of the folded name). Pinned by fixtures in Latin, Cyrillic, Greek, Arabic and Chinese. 2. The service's `GET /people?q=` and the front page's search (via the existing wasm) both use it. 3. The static site ships a sharded index by folded prefix, `names/<prefix>.json`, fetched on demand, so a sandbox of millions searches without a server; the folded form is the key a database (#7, #11) indexes later. Towards #10.
Author
Owner
Released in v0.15.0: https://git.bytestone.uk/hum3/life-weaver/releases/tag/v0.15.0
hum3 closed this issue 2026-10-28 23:28:49 +00:00
Sign in to join this conversation.
No labels
roadmap
story
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hum3/life-weaver#77
No description provided.