Knowledge: Search
Semantic search in the enterprise: full text, vectors, hybrid
Whether a knowledge system finds the right passage is decided in search, long before a language model formulates an answer. Full-text search and vector search find different things, which is why organisations combine them; German text adds its own quirks; and search quality can be measured rather than guessed at.

Short answer
Semantic search ranks results by meaning rather than literal wording, usually using vectors from a language model. It finds rephrasings that full-text search misses, but overlooks exact identifiers such as part numbers. Hybrid search therefore proves itself in organisations: BM25 keyword search and vector search run in parallel, and their rankings get merged.
Definition
Semantic search: Semantic search refers to search methods that rank results by meaning rather than literal wording. Queries and documents are usually translated into numerical vectors with a language model, and the distance between them represents similarity. In organisations it is typically combined with classic full-text search, because exact terms and identifiers would otherwise get lost.
In the glossary: Embedding, Vector database, Hybrid search, Reranking, Late interaction, Retrieval, Retrieval-augmented generation, Visual document search, Gold-standard test set, Evaluation
01
What is semantic search, and how does it differ from full-text search?
Full-text search finds documents that contain the words of the query, and weights rare words more heavily. Semantic search instead compares meaning: the query and the document are represented as vectors, and vectors that sit close together count as similar in content. It therefore also finds documents that describe the same thing in different words.
Say a new employee searches the intranet for how do I request holiday. The actual policy is called absence request via the HR portal and mentions the word holiday only once, in a footnote. Full-text search ranks that page far down, or does not find it at all. Semantic search recognises that requesting holiday and an absence request mean the same thing, and moves the page to the top.
The other way round, a service technician searches for the fault code E-4711 or the standard DIN EN 60204-1. Here, literal matching is everything, and a vector that only knows the rough meaning of a string is more likely to return documents about similar faults than the one correct document. Both methods, then, have complementary strengths. Search itself is covered here; Retrieval-augmented generation explains how it gets embedded into a system that formulates answers, and Knowledge management with AI places it within the wider knowledge management picture.
02
How does classic full-text search work with BM25?
BM25 scores a document by how often the search terms appear in it, how rare those terms are across the whole store, and how long the document is. Repetitions count with diminishing weight, and long documents get penalised. The method is fast, explainable, needs no training, and remains a strong baseline.
The foundation is an inverted index: for every word it stores which documents it appears in. BM25, described in the survey by Robertson and Zaragoza (2009), computes a score for each document from three components.
- Term rarity (inverse document frequency): a word that appears in almost every document contributes little to distinguishing between them, while a rare technical term contributes a lot.
- Frequency within the document, with saturation: more occurrences raise the score, but with diminishing returns. The parameter k1 controls how quickly this saturation sets in.
- Length normalisation: a long document simply contains more words by chance. The parameter b determines how strongly length gets compensated for.
In common search engines, BM25 is the default, in Elasticsearch for instance with k1 = 1.2 and b = 0.75 according to its documentation. The strengths are speed, traceability (it is possible to show which word triggered a match) and precision on exact terms. The weakness is the vocabulary problem: synonyms, rephrasings and other word forms are only found if text analysis normalises them beforehand. For German text, this analysis is exactly the decisive part, addressed in detail later.
03
How does vector search work with embeddings?
An embedding model translates every chunk of text into a vector, a long sequence of numbers. The query gets translated with the same model, and then an index searches for the closest vectors, usually using cosine similarity. Because document vectors are computed in advance, search stays fast even for large stores.
- 01ChunkText from the store
- 02Embedding modelBi-encoder
- 03VectorPosition in meaning space
- 04IndexApproximate nearest-neighbour search
- 05Query vectorSame model
- 06Result listSorted by similarity
The decisive trick is separating query and document. A model that reads both together scores the match very precisely, but has to re-read every document for every query. Reimers and Gurevych (EMNLP, 2019) calculated that finding the most similar pair among 10,000 sentences this way takes around 65 hours, versus about 5 seconds with precomputed sentence vectors (Sentence-BERT). These models are called bi-encoders, the jointly reading ones cross-encoders; the latter get used in reranking.
To avoid comparing every vector with every other one, indexes use approximation methods. HNSW graphs (Malkov and Yashunin, 2016) are common, where search jumps across several levels from coarse to fine neighbourhoods. An adjustable trade-off applies here: more search effort means a higher probability of finding the actual nearest neighbours, but more latency and memory. More on embeddings is in the glossary.
04
Vector search or full-text search: which method finds what better?
Full-text search wins on exact terms, identifiers and rare technical words, vector search wins on rephrasings, synonyms and everyday-language questions. Independent benchmarks show that dense models are not reliably better than BM25 outside their training data. Hybrid search captures both strengths and is therefore the usual starting point for enterprise document stores.
Four search methods side by side
| Criterion | Full text (BM25) | Vector search | Hybrid | Late interaction |
|---|---|---|---|---|
| Finds well | Exact terms, identifiers, rare technical words | Rephrasings, synonyms, everyday language | Both | Fine-grained matches between individual terms and passages |
| Misses | Different words for the same thing | Numbers, standards, proper names | Little, if both halves are well tuned | Hardly anything, but costly to run |
| Explainability | High: a match traces back to a word | Low: closeness in vector space | Medium | Medium: the contribution of each query term is visible |
| Indexing cost | Low | One model call per chunk | Both | Many vectors per chunk |
| Storage needs | Low | One vector per chunk | The sum of both | High, one vector per token |
| Effort for German | Analysis needed: decompounding, stemming, umlauts | Model choice is decisive | Both | Model choice is decisive |
The two benchmarks explain why blanket judgements fail in either direction. BEIR (Thakur et al., 2021) tested search models on datasets they were not trained for: reranking and late-interaction models achieved the best scores on average, while dense models often generalised worse than BM25. MTEB (Muennighoff et al., 2022) found no embedding method that led across many tasks and languages. For an organisation's own store, only a measurement with its own questions counts.
05
How do you combine both methods (hybrid search with Reciprocal Rank Fusion)?
Hybrid search runs keyword search and vector search in parallel and merges the two rankings. Reciprocal Rank Fusion does this by adding, for each document and each list, the value 1 divided by 60 plus rank. Documents that rank high in both lists win out. The two methods' scores do not need to be comparable for this to work.
The problem with combining them is that BM25 scores and similarity scores sit on completely different scales. They can be normalised and added with weights, but the weights then have to be tuned for every store. Reciprocal Rank Fusion sidesteps this by using only the ranks. Cormack, Clarke and Büttcher (SIGIR, 2009) set the constant at 60 in a preliminary study and found that the fusion outperformed the best individual systems almost consistently. The constant dampens the advantage of the very top spots, so that agreement between the lists counts for more than a single top ranking.
| Document | BM25 rank | Vector rank | Calculation | RRF score | Result |
|---|---|---|---|---|---|
| B | 3 | 1 | 1/63 + 1/61 | 0.0323 | Rank 1 |
| A | 1 | 4 | 1/61 + 1/64 | 0.0320 | Rank 2 |
| C | not found | 2 | 1/62 | 0.0161 | Rank 3 (tied) |
| D | 2 | not found | 1/62 | 0.0161 | Rank 3 (tied) |
function rrf(rankings, k = 60) {
const scores = new Map();
for (const list of rankings) {
list.forEach((id, index) => {
const rank = index + 1;
scores.set(id, (scores.get(id) ?? 0) + 1 / (k + rank));
});
}
return [...scores.entries()].sort((a, b) => b[1] - a[1]);
}
// rrf([["A", "D", "B"], ["B", "C", "X", "A"]])Document B wins, even though keyword search only ranked it third, because both methods consider it relevant. RAG-Fusion uses the same principle, merging several rephrasings of a question, see F-RAG (RAG-Fusion). In good systems, fusion is followed by reranking of the best candidates; more on hybrid search is in the glossary.
06
What is distinctive about German-language documents (compounds, inflection, umlauts)?
German text forms long compound words, inflects heavily, and spells umlauts inconsistently. Keyword search therefore needs decompounding, stemming, and normalisation of umlauts and the letter ß. Embedding models absorb much of this, but not all of it, which is why both sides should be tested against German questions.
Without text analysis, keyword search will not find Tasse (cup) inside Kaffeetasse (coffee cup), or Prüfung (exam) inside Prüfungen (exams). Search engines ship filters for this. Elasticsearch's Hyphenation Decompounder, for example, searches for possible sub-words using hyphenation patterns and keeps only those that appear in a word list; from Kaffeetasse it thereby also produces the entries Kaffee and tasse. Apache Lucene's GermanNormalizationFilter replaces ß with ss and ä, ö, ü with a, o, u, so that Müller and Mueller match the same entry.
| Phenomenon | Example | What keyword search needs | Behaviour of vector search |
|---|---|---|---|
| Compounds | Kaffeetasse, Wartungsintervall | Decompounding using hyphenation patterns and a word list | Usually robust with a good German model, check rare technical compounds |
| Inflection | Prüfung, Prüfungen, geprüft | Stemming, for instance with the Snowball algorithm for German | Word forms usually sit close together |
| Umlauts and ß | Müller and Mueller, Maß and Mass | Normalising the spelling variants | Depends on the model, test variants |
| Over-normalisation | schön and schon collapse into one after umlauts are stripped | A normalised search field plus an original field for exact matches | Not affected |
| Identifiers | E-4711, DIN EN 60204-1 | Tokenisation that preserves digits and hyphens, a dedicated field | Weak, because character strings carry no meaning |
| In-house abbreviations | AA for work instruction, QM for quality management | A synonym list built from an organisation's own store | Only if the abbreviation appeared during training |
07
What must a vector database do for enterprise search?
A vector database stores embeddings and finds approximate nearest neighbours quickly. For enterprise stores, what also counts is filtering by metadata and access rights during search, updating and deleting individual entries, hybrid queries, multiple vectors per document where needed, and a plannable rebuild when the embedding model changes.
A vector database can be a standalone system or an extension of an existing database or search engine. The choice of product matters less than whether the following properties are met for a given store. Filtering is especially tricky: if rights are filtered only after the neighbour search, ten matches might shrink to two, and the rest of the correct documents were never even checked. Access control in AI knowledge systems describes how rights get carried cleanly through search.
Checklist
Checking the requirements for a vector index
Work through these points for a given store before settling on a system.
08
What is late interaction (ColBERT), and when does it pay off?
Late interaction, known from ColBERT (Khattab and Zaharia, SIGIR 2020), stores one vector per token instead of one vector per chunk, and only compares each query term against its best-matching passage at search time. This matches more finely than a single vector, but costs considerably more storage, which is why it is often used only for reranking.
A single vector averages an entire chunk down to one mean. Late interaction (late interaction) keeps the individual parts and sums the best match for each query term. Carried over to page images, the same principle sits behind visual retrieval models, see Understanding documents with AI. Late interaction explained covers the setup with a fast first pass and precise rescoring.
09
How do you measure whether search is any good (Recall@k, nDCG)?
Search quality gets measured with a test set of real queries and known relevant documents. Recall@k states what share of the relevant documents falls within the first k results. nDCG additionally scores order and graded relevance: a highly relevant document at rank 1 counts for more than one at rank 8.
Gathering queries
Real search queries from logs or conversations, including vague and misspelled ones.
Setting relevance
Experts mark the matching documents for each query, ideally graded as highly, partially and not relevant.
Calculating metrics
Recall@k and nDCG@k for every search variant on the same test set.
Comparing changes
Every change to analysis, model or fusion runs against the same test set before it goes live.
A worked example: for one query there are three relevant documents, two of which fall within the first five results. Recall@5 then comes to 2 out of 3, or about 0.67. Recall only counts whether something was found, not where. The definitions appear in the textbook by Manning, Raghavan and Schütze (2008); the graded scoring with rank discount goes back to Järvelin and Kekäläinen (ACM TOIS, 2002). For RAG, Recall@k is the most important value, because the model only ever sees what got retrieved. Checking AI answers shows how whole answers get scored on top of that.
Common assumptions about semantic search
No.
For identifiers, standards and proper names, keyword search stays more precise. In BEIR, BM25 proved a robust baseline.
Not necessarily.
MTEB shows that no model leads across every task. Vocabulary and language decide, so an organisation's own test set is what counts.
No.
It measures closeness between vectors. Negations, numeric ranges and exceptions get lost easily in the process.
No.
Individual results are deceptive. Only metrics over a fixed test set show whether a change helps or hurts.
Read more on iiterate.de
More from the knowledge pages
- Knowledge Knowledge management with AI Where search sits within the lifecycle of enterprise knowledge.
- Knowledge Retrieval-augmented generation The pipeline, chunking strategies and failure modes of RAG systems.
- Knowledge Access control in AI knowledge systems Filtering access rights during search rather than afterwards.
- Knowledge Understanding documents with AI When visual search complements or replaces OCR.
Signals on search
- Signal Late interaction explained MaxSim and multi-vector search made concrete, with a two-stage setup.
- Signal F-RAG (RAG-Fusion) Reciprocal Rank Fusion across several query variants.
- Signal The OCR-free document stack Visual retrieval models and how they fit in.
- Signal Query decomposition Hybrid search and reranking as the foundation before further techniques.
Implementation and reference
Frequently asked questions
Does semantic search need a GPU?
Not necessarily. What is computationally intensive is mainly embedding the store, which runs markedly faster on a GPU for large volumes. Embedding individual queries and the neighbour search in the index are far less demanding. Whether existing hardware is enough depends on store size, model and response time, and can be settled with a trial run on part of the store.
Can an existing intranet search stay in use?
Often, yes. Many search engines that run on BM25 today can be extended with vector fields and hybrid queries. That keeps the existing text analysis for German in place, and vector search comes in as a second ranking. Whether that holds up is shown by comparing both variants on a shared test set, before a second system gets introduced.
What is the difference between semantic search and RAG?
Semantic search delivers a result list that a person reads. RAG uses such a search as a first step and has a language model formulate a source-backed answer from the best results. A RAG system can therefore never know more than its search finds: improving answer quality usually starts with the search.
How large should text chunks be for vector search?
Large enough to hold a complete thought, small enough that the vector still represents one topic. Chunks cut at headings and paragraphs usually work better than fixed character lengths. The right size is a measurement question: compare two or three variants using Recall@k on a given test set. Retrieval-augmented generation compares the strategies in more depth.
Does vector search also find documents in other languages?
With multilingual embedding models, yes: a German query can then find an English document with the same meaning, because both sit in the same vector space. Quality varies by model and language pair. Full-text search cannot do this without translation. Cross-language matches should be tested explicitly on the test set if a store is mixed.
When does a vector index need to be recomputed?
Individual entries get re-embedded whenever a document changes. The whole store has to be recomputed when the embedding model changes or the chunking changes, because old and new vectors are not comparable. This rebuild gets prepared alongside the running index and only switched over after comparison on the test set.
Read on
Related topics
Sources
- 01 The Probabilistic Relevance Framework: BM25 and Beyond Robertson und Zaragoza, Foundations and Trends in Information Retrieval, 2009 · dl.acm.org
- 02 Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks Reimers und Gurevych, arXiv, EMNLP 2019, 2019 · arxiv.org
- 03 Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs Malkov und Yashunin, arXiv, 2016 · arxiv.org
- 04 BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Models Thakur et al., arXiv, NeurIPS 2021, 2021 · arxiv.org
- 05 MTEB: Massive Text Embedding Benchmark Muennighoff et al., arXiv, 2022 · arxiv.org
- 06 Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods Cormack, Clarke und Büttcher, ACM SIGIR, 2009 · dl.acm.org
- 07 ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT Khattab und Zaharia, arXiv, SIGIR 2020, 2020 · arxiv.org
- 08 Cumulated gain-based evaluation of IR techniques Järvelin und Kekäläinen, ACM Transactions on Information Systems, 2002 · dl.acm.org
- 09 Introduction to Information Retrieval: Evaluation of ranked retrieval results Manning, Raghavan und Schütze, Cambridge University Press, 2008 · nlp.stanford.edu
- 10 Similarity settings Elastic, Elasticsearch-Dokumentation, 2026 · elastic.co
- 11 Hyphenation decompounder token filter Elastic, Elasticsearch-Dokumentation, 2026 · elastic.co
- 12 GermanNormalizationFilter Apache Lucene, API-Dokumentation, 2026 · lucene.apache.org
- 13 German stemming algorithm Snowball, 2026 · snowballstem.org
Let us talk about your project
Whether it is a prototype, an internal tool or an AI application: describe briefly what you are building or want to take into production.