What is lexical-plus-vector retrieval?
Lexical-plus-vector retrieval is hybrid search that runs keyword scoring (typically BM25 over an inverted index) and dense ANN (often HNSW over embeddings) in parallel, then fuses the two ranked lists so results can match exact terms and semantic neighbors in one response.
Why does either channel alone leave gaps?
Pure vector search embeds the query and walks the HNSW graph for nearby documents. It shines when users paraphrase – "catch" near fishing context – but can under-rank rare proper nouns, SKUs, error codes, or mandated phrases the embedding space blurs. Pure lexical search rewards term frequency and rarity: an exact product id or uncommon scientific name jumps to the top, yet it misses synonyms and conceptual cousins that never share tokens. Lexical-plus-vector retrieval keeps both evidences. The inverted index catches literal hits; the vector index catches meaning. Fusion decides the final order so a document that wins only one lane can still surface when that lane’s signal is strong.
The pipeline is therefore two retrievals plus a merge, not a single blended score inside HNSW.
How does a lexical-plus-vector query actually execute?
Given one query string (and optionally a supplied query vector), the system issues a BM25/BM25F search over selected text properties and a vector search (nearText-style embedding or bring-your-own vector) with its own candidate depth. Each arm returns a ranked list with raw scores that live on incompatible scales – BM25 magnitudes and cosine distances are not interchangeable. A fusion method maps both lists into a common ranking: rank-based schemes such as reciprocal rank fusion score by position; score-normalization schemes rescale each list’s metrics to a shared range then combine. An alpha (or equivalent weight) tilts the blend toward keywords (alpha near 0) or vectors (alpha near 1). Property filters can still constrain eligible objects so hybrid does not bypass business rules. Latency is roughly the slower arm plus fusion – both indexes must be warm and correctly tokenized or embedded.
Choosing fusion and alpha is where product taste meets evaluation.
When should you lean lexical, vector, or the middle?
Catalog and support search with many exact identifiers often want lower alpha so BM25 can promote literal matches. Exploratory or FAQ-style natural language benefits from higher alpha so HNSW semantic neighbors dominate. Relative-score fusion preserves gaps in the original metrics – useful when one arm has a clear winner and the other is flat. Ranked fusion treats every rank step similarly and can hide large score margins. Always validate on labeled queries that include both "must match this token" and "same meaning, different words" cases; a single alpha rarely fits every vertical. Hybrid is a strong default starting point for RAG retrieval because it reduces the chance that a critical exact passage is lost to embedding paraphrase failure.
Weaviate exposes this pattern as first-class hybrid search beside HNSW and BM25.
How do you run lexical-plus-vector retrieval in Weaviate?
Call hybrid search with a query string; Weaviate runs BM25F and vector search together and fuses results. Set alpha between 0 (keyword only) and 1 (vector only); defaults weight toward vector while still mixing lexical signal. Choose fusionType: relativeScoreFusion (default on recent versions) normalizes each arm’s scores before combining; rankedFusion combines rank-based contributions. Optionally pass your own query vector, limit BM25 to specific properties, and attach the same structured filters used elsewhere so allow-lists apply. Tune candidate limits so each arm contributes enough unique hits for fusion to matter. After embedding-model or tokenizer changes, re-check hybrid quality – lexical and vector arms can drift independently.
Operational failures usually mean one arm was misconfigured, not that fusion math is mysterious.
What should you monitor when hybrid is in production?
Track per-arm contribution: how often top hybrid hits came primarily from BM25 versus vector. Empty or weak keyword arms may indicate tokenization, stopword, or property-selection issues; weak vector arms point to embedding or HNSW ef problems. Measure recall and nDCG on mixed query sets, and watch p95 latency as both indexes grow. Do not confuse hybrid fusion with filtered HNSW oversampling – filters gate eligibility; lexical-plus-vector merges two relevance signals. For RAG, inspect whether fused context still cites the exact statute, version string, or SKU the user named.
Lexical-plus-vector retrieval is hybrid ANN – BM25 for literals, HNSW for meaning, fusion for one ranked list. Next, read "What is reciprocal rank fusion?" for the rank-based merge in detail, then "What is database-aware index selection?" for how a query planner chooses lexical, vector, hybrid, or flat paths from selectivity and intent.