
Multilingual Site Search: Language-Aware Relevance
One analyzer cannot serve every language, and the failures are silent. Here are the tokenization tiers, the two index topologies, and the cross-locale parity that goes untested when only the home locale is measured.
TL;DR: Stemming rules and stopword lists are built for one specific language, and whether character folding is safe depends on the language, so an English-configured analysis pipeline applied to every locale silently mis-stems, strips content words, and folds meaning away. Language-aware search means assigning analysis per field and locale, choosing an index topology that scales with locales, curating synonym dictionaries per language rather than translating them, and testing relevance parity so the second and tenth locales are not quietly worse than the first.
Analysis is a per-language decision
Text analysis is not a neutral preprocessing step. A stemmer encodes the morphology of a particular language. A stopword list encodes which words carry no meaning in a particular language. Character folding discards distinctions, and whether that is safe depends on the writing tradition. Apply one language's answers to another language's content and the failures are silent — nothing errors, the index builds, and relevance is quietly worse than anyone measures.
The failure register is concrete. Languages with richer inflection than English — more cases, more plural forms, more agreement — defeat an English stemmer, which reduces words it does not recognize according to rules built for a different morphology, so different inflected forms of the same word may not be reduced to a shared token, and a query in one form can miss documents that use another. Stopword collisions are the sharper failure: a short function word in one language is a content word in another, so a shared stopword list can strip the most important term in a query. And accent folding, which is correct and helpful in some languages, is lossy in others where a diacritic distinguishes two different words entirely.
Engines ship per-language analyzers as configuration rather than as a feature to build. The dedicated-engine class maintains a catalog of language analyzers (Elasticsearch language analyzers reference, as of November 2026), and the database-native route offers per-language dictionary and stemming configuration in its text-search support (PostgreSQL text search dictionaries, as of November 2026). The craft is not building analyzers; it is assigning the right one to each field and locale, and doing so at index time, because analysis is bound to the document when it is indexed rather than negotiated at query time.
One scope note on how this is framed. The treatment here works at script-family scope — space-delimited alphabetic scripts, CJK, compound-heavy languages — rather than as a deep dive on any single locale, and the engineering decisions below are grouped by script family rather than by individual language.
Where tokenization gets hard
Space-delimited alphabetic scripts are the easy tier, and it is worth saying why so the harder tiers are legible by contrast. Whitespace approximates word boundaries well enough that tokenization is nearly free, and the remaining work is per-language stemming and stopword handling.
CJK is where whitespace stops being enough: Chinese and Japanese do not mark word boundaries with spaces, and Korean, although written in segments delimited by spaces, attaches grammatical suffixes that Korean standards treat as separate words, so one space-delimited segment can hold more than one word. Tokenization requires segmentation — deciding where one word ends and the next begins from the character sequence itself. Two approaches exist at concept level: dictionary-based segmentation, which matches against a lexicon and handles known vocabulary well while struggling with new terms and proper nouns, and statistical segmentation, which infers boundaries from learned patterns and handles novelty better at the cost of predictability. That word boundaries are genuinely non-trivial is a standards-level fact rather than an implementation opinion, documented in the Unicode text segmentation report (Unicode Standard Annex 29). Engines also offer n-gram indexing as a pragmatic fallback: index every overlapping character sequence of a fixed length and let matching find its own boundaries. It works, it is simple, and its cost is precision — n-grams match fragments that span word boundaries, producing matches that are technically present in the text and meaningless to a reader.
Compound-heavy languages form a third tier. Where a language freely forms long compound words, users can search by one component of a compound that appears in the corpus only in its assembled form. Matching that component takes decompounding support in the analyzer or another route such as n-gram indexing, with the precision cost noted above (Elasticsearch's n-gram tokenizer documentation describes n-grams as useful for querying languages that have long compound words, like German, as of November 2026), and whether a given engine and language combination offers decompounding usefully is a capability to verify against current documentation rather than assume.
The takeaway is uncomfortable and worth stating plainly: tokenization quality bounds everything downstream on the keyword-matching path. No amount of field weighting and no synonym dictionary rescues keyword matching over an index whose tokens do not correspond to the units speakers of that language actually type, and a semantic layer that only reranks those keyword matches inherits the same limit.
Index topology and query routing
This section compares two topologies, and the choice compounds through everything else.
| Dimension | Index per locale | Multilingual fields in one index |
|---|---|---|
| Analysis | Clean — one analyzer per index | Per-field analyzer routing within the document |
| Tuning | Independent weights and config per locale | Shared config, per-field overrides |
| Sync pipeline | One pipeline per locale to operate | One pipeline covering all locales |
| Cross-language noise | Avoided as long as the query reaches the right locale index | Possible if queries reach the wrong fields |
| Scaling with locale count | Index count grows linearly | Field count grows, document size grows |
Neither is the right answer generically. Index-per-locale buys clean separation and independent tuning at the cost of operating more indexes; multilingual fields buy one pipeline at the cost of careful per-field routing. Per-field analyzer support is worth checking against your engine's current documentation before committing.
Query routing is where an easy mistake lives. The honest default is routing by UI locale: the language the user is browsing in is a strong signal for which analyzer their query needs. Automatic language detection on the query string is tempting, but its accuracy depends on how much text it gets: Elasticsearch's language identification documentation says longer text is identified more accurately, and that the model is fairly accurate on short samples (for example, 50-character streams) in certain languages, but languages that are similar to each other are harder to identify from a short character stream (as of November 2026). Site search queries are short and can be proper nouns, which leaves little signal for confident detection. Worse, mixed-language queries happen: users type local prose around an untranslated brand or product term, and a detector can confidently assign one language to a string that is genuinely two. Designing for the mixed case — where the locale's analyzer handles the prose and exact matching catches the foreign term — beats trying to classify it.
Cross-locale content asymmetry deserves stating rather than papering over. Locales do not necessarily have equal corpora. A site with ten thousand documents in its home language and four hundred in a newer market cannot make search in the smaller locale behave as if the other nine thousand six hundred existed. What it can do is degrade honestly: broader matching, disclosed as broader, rather than an empty result set presented as though the catalog were complete. Pretending parity produces a user who concludes the site has nothing for them.
And every topology choice multiplies through the synchronization pipeline. Index-per-locale means reindex events and freshness contracts apply per locale, and a full rebuild is now a rebuild of several indexes with a swap sequence to coordinate. That cost belongs in the topology decision rather than being discovered after it.
Per-language dictionaries and relevance parity
The synonym rule for multilingual search is short: dictionaries are curated per language, from that locale's own failed queries, and never machine-translated from the home locale. The reason is that a synonym dictionary is not a vocabulary list — it is a record of the specific ways users of one language describe things differently from how the catalog describes them. That mapping is language-specific domain knowledge. Translating the home locale's entries can produce pairs that are linguistically correct and behaviorally useless, because the users of the target locale may not share that confusion, while the confusions they do have can go unrepresented.
Cross-locale relevance parity is the silent failure this whole surface exists to prevent. Search quality gets built, tuned, and measured for the home locale. The other locales can inherit the code without the attention, and if nobody runs queries in them, nobody finds out. The counter-discipline is the same golden-query discipline used everywhere else, run per locale — with query sets written in each locale from that locale's real traffic, not translated from the home set, for exactly the reason synonym dictionaries are not translated.
Analytics segmentation is what makes the failure visible in the first place. Zero-result rate and click-through read per locale rather than in aggregate, because an aggregate dominated by the home locale's healthy numbers hides a smaller locale where search is failing most of its users. A single global zero-result number is one of the easier ways to be confidently wrong about search health across a multi-locale site.
Two boundaries close this out. Market selection, translation workflows, hreflang, and the operations of entering a locale as a market are decision-maker questions covered in the multilingual-localization literature. And code-level internationalization — message formatting, the browser locale APIs, translation-key architecture, locale routing, right-to-left layout implementation — is a separate engineering discipline deliberately outside this topic; what belongs here is search analysis and relevance across languages.