SearchState as of: 2026-10
Accent-insensitive search for a bilingual static site
How a serverless search finds Hungarian words typed without accents, with typos and in inflected forms, and what that costs in index size.
Research question: How can a serverless search find Hungarian words typed without accents, with typos and in inflected forms?
Project requirement
A bilingual static portfolio with search and no external service. Hungarian visitors often type without accents, and Hungarian words appear with suffixes in the text, for example "modellekkel".
Method and validation
- One index per language generated at build time, searched in the browser with MiniSearch.
- The same normalization at indexing and query time: Unicode NFD decomposition, removal of diacritic marks, lower case.
- Prefix matching with a fuzzy tolerance of 0.2, every query word required, title and tags weighted higher.
- Checked on the built Hungarian index (2026-10-10, 43 entries): "feltöltés" and "feltoltes" return the same 5 results; "nyelvi modell" and the misspelled "nyelvi modelek" both return 4, led by the small language model research; the fragment "kepoptim" also matches.
- Measured on 2026-10-10, with 43 index entries; index size: English 34.7 KB (10.8 KB gzipped), Hungarian 38.8 KB (12.1 KB gzipped).
Findings
- Removing diacritics on both sides gives accent-insensitive search without a Hungarian dictionary.
- Prefix matching covers most suffixes, because Hungarian suffixes follow the word stem ("modell" matches "modellekkel").
- The fuzzy tolerance handles common typos such as a missing double consonant.
- At this content size, loading the whole index on first focus is cheap; a split index is not needed.
Decision
One index per language, loaded lazily, with NFD normalization, prefix matching, fuzzy 0.2 and all words required. No stemming.
Limits and open questions
- Words whose stem changes, for example "tó" and "tavak", are not matched by prefix; that would need a Hungarian stemmer.
- Removing accents can merge different words, for example "kor" and "kór"; this was not examined separately.
- The index grows with the content; much larger content would need a split index or another tool.