Type to search. Arrow keys to move, Enter to open, Esc to close.

All technologies

Client-side search

Full-text search with an index built as a static file at build time and queried in the browser, without a server or a third-party service.

Project requirement

A searchable static portfolio in two languages with no search service.

Technical question

How can a static site offer fast, forgiving search without sending queries anywhere?

Validation

One prebuilt index per language, loaded on first focus; the same term normalization at indexing and query time, prefix and fuzzy matching, and weighted fields. Tested on the Hungarian index with accents, typos and suffixes.

Decision

One index per language serves both the global search dialog and the per-section search boxes; section filtering happens on the client.

The long text of detail pages is indexed too, so a list-page search finds it.

Search results are also sent as a page event, so the card list and the knowledge graph can react to them.

Implementations by language

TypeScript

An Astro endpoint writes /search/<lang>.json at build time; MiniSearch loads it once per language with accent-free normalization, prefix and fuzzy matching.

  • The same processTerm must be set for indexing and for search.
  • Caching the loading promise prevents a duplicate download.

Used by projects

Related research