TECHNOLOGY

Russian keyword retrieval: stemming must not destroy exact identifiers

In this article
THE QUICK TAKE

Morphological search and exact identifier lookup need separate representations when a revision suffix changes product applicability.

Russian BM25 search should separate linguistic matching from exact identifier matching rather than forcing both into one analyzed field. Stemming can improve inflected-word retrieval while obscuring literal distinctions in product codes, revision labels or technical strings that must remain intact for a correct answer.

Inspect the Russian analyzer’s output

The official language analyzer reference describes the Russian analyzer and its components. Analyze representative questions and documents before deciding what terms the index contains. Morphological processing serves natural language, not every technical token. A visually similar product code can be split or transformed in a way that changes matching behavior. Inspect tokens rather than assuming the original string is preserved exactly.

Keep an exact representation deliberately

The keyword analyzer reference describes a single-token representation. Exact identifier handling needs a declared policy for case, separators and source normalization. A keyword representation alone does not decide whether two differently formatted codes should be equivalent. Preserve the source form and introduce normalized variants only where the domain explicitly permits them. Do not normalize away a suffix that distinguishes two hardware revisions.

Build a mixed-language retrieval fixture

Use Russian descriptions containing an English component identifier and revision suffix. Ask an inflected Russian question, then an exact-code question and a question with a near-identical but wrong suffix. The natural-language path should support morphology, while the identifier path should preserve the technical distinction. These examples reveal whether a convenient analyzer improves topic matching at the expense of selecting the wrong product.

Field roleIntended behavior
Russian descriptionMatch linguistic variants
Exact identifierPreserve declared literal distinction
Display source formReconstruct the original code
Revision metadataFilter applicability explicitly

Combine fields under an explicit query

The multi_match reference documents querying multiple fields and field weighting. Weights express retrieval policy; they are not probabilities of correctness. Keep exact-code behavior visible when adjusting description boosts. A high semantic or linguistic score should not silently override a known incompatible revision. Depending on the task, revision applicability may belong in a filter rather than an additional weak scoring preference.

Inspect disagreements before tuning weights

Review cases where the description path and exact identifier path return different documents. Check tokenization, normalization and field mapping before increasing a boost. Keep the analyzer configuration with index revision because changing analysis can require rebuilding the relevant representation. Report retrieval coverage and exact-code mistakes separately. This produces a search policy that supports Russian language variation while preserving technical identity, instead of claiming that one analyzer is universally optimal for every kind of document content.

Related reading: Evaluating embeddings for Russian language retrieval; A local RAG server: placing components around the GPU.

← All articles