Scrivio Interview library
DesignAdvanced6 min read · updated 12 November 2026

Your marketplace operates in 12 languages, including Japanese and German. How would you design analysis and indexes for multilingual search, and what trade-offs come with each option?

There are three main designs: one index per language, one field per language in a shared index, or a single field with language detection at index time. In each, the key is a language-specific analyzer, such as kuromoji for Japanese, which segments text morphologically because Japanese has no spaces, and decompounding for German, which splits compound words. Per-language fields or indices keep scoring statistics separate and analyzers correct, but queries must target the right field; synonyms and spelling corrections need an owner per language, and relevance must be measured with test sets per language.

Why this question is asked

A marketplace in 12 languages has 12 different search problems that look like one. Japanese text has no spaces between words, German glues nouns into long compounds, and every language stems differently. A single analyzer cannot handle all of them, and a design that mixes them in one field produces quiet relevance failures that nobody notices until a market complains. Interviewers ask this design question to see whether we understand analysis deeply enough to structure indices around it. In this answer, we will see why one analyzer is not enough, look at Japanese and German specifically, compare the three index designs, and cover synonyms and evaluation.

1Why One Analyzer Does Not Fit All Languages

An analyzer turns text into terms for the inverted index. The standard analyzer splits on spaces and punctuation and lowercases, which works passably for English and many European languages. But stemming, stop words and even what counts as a word are language rules. 'Running' -> 'run' is English logic; German and French have their own stems; and some languages do not separate words with spaces at all.

If we run every language through one analyzer, we either get no stemming at all, so 'Schuhe' does not match 'Schuh', or we apply the wrong language's rules and merge unrelated words. Search engines ship language analyzers for this reason, and the design question is how to route each piece of text to the right one.

2Japanese and German Need Special Care

Japanese is written without spaces, mixing kanji, hiragana and katakana. The standard tokenizer cannot find word boundaries, so it falls back to splitting into single characters or long runs, which makes matching noisy. The kuromoji plugin (analysis-kuromoji) does morphological analysis: it uses a dictionary to split a sentence into words and can reduce verbs and adjectives to their base form. An alternative is the cjk_bigram approach, which indexes overlapping pairs of characters; it needs no dictionary and handles new words, but it produces more false matches and a larger index.

German builds compound nouns: 'Damenlaufschuhe' means women's running shoes. A user searching for 'Laufschuhe' expects it to match, but with the standard analyzer the compound is one term that contains no separate 'laufschuhe'. A decompounding filter, dictionary_decompounder or hyphenation_decompounder with a German word list, adds the parts as extra tokens. The built-in german analyzer handles stemming and umlaut normalisation, but not decompounding, so we add it in a custom analyzer.

YAML
PUT /listings
{ "settings": { "analysis": {
"filter": { "de_split": { "type": "hyphenation_decompounder",
"hyphenation_patterns_path": "analysis/de_DR.xml",
"word_list_path": "analysis/de_words.txt", "only_longest_match": true },
"german_stem": { "type": "stemmer", "language": "light_german" } },
"analyzer": {
"de_text": { "tokenizer": "standard",
"filter": ["lowercase", "de_split", "german_normalization", "german_stem"] },
"ja_text": { "type": "kuromoji" } } } } }
// de_text: "Damenlaufschuhe" -> damenlaufschuh, dam, lauf, schuh (depending on the word list)

The exact output depends on the word list and patterns, which is exactly why decompounding needs testing with real product titles from the German market.

3Comparing the Three Index Designs

With the analyzers chosen, we must decide where each language's text lives.

Multilingual index designs
DesignStrengthsCosts
One index per languageown analyzers, stats, shards and tuning per market12 indices to operate; cross-language search needs many indices
One field per language, shared indexone document per product, title.de, title.ja ...many fields; queries must pick fields; stats per field
Single field, language detectedsimplest query, one fieldmixed stats, wrong analyzer on misdetection, short text detects badly
Per-language fields or indices are the usual choice when listings have a known language.

Statistics matter more than they seem. BM25 weights a term by how rare it is in the field. If German and English share a field, the rarity of 'gift', which means poison in German, is computed across both languages, and scores in each language are distorted by the other. Per-language fields or indices keep statistics separate.

For this marketplace, where each listing is written in a known language and users browse one market at a time, I would choose one field per language in a shared index, or one index per language for the largest markets if they need separate scaling. The query then targets the user's language field, for example title.ja for the Japanese site, optionally with a lower-boosted English field for listings written in English. Language detection on a single field is attractive only when the language of each document is unknown, and it misfires on short titles.

4Synonyms, Spelling and Ownership

Synonyms are language specific: 'sneakers' and 'trainers' are English synonyms, German needs 'Turnschuhe' and 'Sneaker', and Japanese often needs katakana and kanji variants mapped together. The same goes for spelling corrections and common misspellings. Someone must own each list, ideally a person who knows the language and the market, with a review process and a way to deploy changes. Synonym sets can usually be updated without reindexing when they are applied at search time with a reloadable search analyzer, which makes that ownership practical.

5Evaluating Per Language

A single relevance metric across all markets hides failures. If English improves by 5 percent and Japanese drops by 20 percent, a global average might still rise. So I would keep a judged query set per language, a few hundred real queries with relevance judgments from native speakers, and track a metric such as NDCG@10 and the zero-result rate per language. Every analyzer change runs against the affected language's set before rollout, and online metrics such as click-through and conversion are watched per market after it.

6Follow-up questions

How do we handle a listing that mixes languages, like an English brand name in a Japanese title?

Kuromoji keeps Latin-script words as tokens, so 'Nike' is still searchable in the Japanese field. For listings that are fully bilingual we can index both language fields from the same document.

What about users who search in a different language from the listing?

Query several language fields with a multi_match, the user's language boosted highest. Machine translation or vector search can help with true cross-language search, at extra cost.

Do language analyzers need plugins?

Many are built in, such as german and english. Kuromoji for Japanese and ICU for Unicode handling are plugins that must be installed on every node; managed services usually offer them as options.

7Conclusion

In this answer, we saw that analysis rules differ by language, so multilingual search needs language-specific analyzers: kuromoji for Japanese, which segments text without spaces, and decompounding for German compounds. We compared one index per language, one field per language and a single detected field, and chose per-language fields for listings of known language because they keep analyzers correct and statistics separate, at the cost of targeting fields in queries. Synonyms and spelling need per-language owners, and evaluation needs judged query sets per language.

What to say in the interviewAbout 90 seconds aloud

Open with

I would start from the fact that analysis is language specific: tokenisation, stop words and stemming all differ. Japanese has no spaces, so I would use the kuromoji analyzer, which does morphological segmentation with a dictionary, or cjk bigrams as a fallback.

Then, if they want more

German has compound words, so I would build a custom analyzer with a decompounder and a German word list plus German normalisation and stemming, and test it on real titles. Then there are three designs. One index per language gives fully separate analyzers, statistics and scaling but more indices to run.

One field per language in a shared index, like title.de and title.ja, keeps one document per product with correct analyzers and separate scoring statistics, but the query has to target the right field. A single field with language detection is the simplest to query, but mixed statistics distort BM25 and short titles get misdetected.

For a marketplace where listings have a known language, I would use per-language fields, or separate indices for the biggest markets, and query the user's language field with English as a lower boost. Synonyms and spelling corrections are per language too, so each needs an owner who knows the market.

And I would evaluate with a judged query set per language, tracking NDCG and zero-result rates per market, not one global number.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Elasticsearch documentation
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your marketplace operates in 12 languages, including Japanese and German. How would you...": https://scrivio-interview-library.netlify.app/databases/search-engines/751c9432e0/