Skip to content
Archēglyph

Hybrid search

Running lexical and semantic search over the same query at once and fusing the two ranked result lists, rather than picking one engine.

Last updated

On this page
  1. The problem it solves
  2. How the results are combined
  3. A worked example
  4. Comparison of the three modes
  5. When to bypass hybrid and pick one engine
  6. Limitations
  7. Not to be confused with
  8. Bottom line
  9. FAQ

Hybrid search runs a lexical query and a semantic query over the same search box at once, then fuses the two ranked result lists into one. Neither engine is asked to do the other’s job — BM25 still matches exact terms, vector search still matches meaning — but the researcher sees one merged ranking instead of having to run two searches and reconcile them by hand.

The problem it solves

Lexical search is precise but literal: search “vessel” and a passage that only says “ship” will not match, no matter how relevant it is. Semantic search is the mirror-image failure: it will happily surface a passage about “ship” for a query about “vessel,” but it can also miss an exact phrase or a proper noun a researcher specifically needs, because embedding models compress rare or unusual tokens (personal names, technical jargon, archaic spelling) less reliably than common vocabulary. Neither failure mode is rare in archival material, where a search might need both an exact 19th-century spelling and its modern synonym to surface everything relevant.

How the results are combined

Archēglyph’s search runs the query against the lexical (Tantivy BM25) index and the semantic (zvec cosine) index at the same time, then merges the two ranked lists with reciprocal rank fusion into the single relevance score shown against each snippet. The Lexical | Hybrid | Semantic toggle on the search box lets a researcher fall back to either engine alone — useful when the fused ranking surfaces a result that seems out of place and you want to see which engine is responsible for it.

A worked example

Searching a corpus of shipping correspondence for steamship arrival: a lexical-only search returns every document containing that exact phrase, ranked by how central those words are to each document — precise, but it misses a letter that only ever says “the vessel docked Tuesday” without using either word. A semantic-only search finds that letter, ranked by meaning — but it might also rank a document about “steamship construction” above a shorter, more directly relevant one, because construction and arrival share enough surrounding vocabulary to look similar in embedding space. Hybrid search returns both: the exact-phrase matches lexical search is confident about, and the paraphrased matches only semantic search would have found, fused into one list rather than forcing a choice between the two searches.

Comparison of the three modes

ModeFinds exact phrasesFinds paraphrases/synonymsBest for
LexicalYesNoKnown phrase, proper noun, exact spelling
SemanticWeaklyYesA concept, when the wording is unknown
HybridYesYesThe default — general-purpose queries

When to bypass hybrid and pick one engine

Hybrid is the sensible default, but it is not always the right tool. Searching for a specific citation format, an exact archival reference number, or a name spelled an unusual way is better served by lexical-only search, where fusion with a semantic ranking that has no strong opinion about an arbitrary alphanumeric string can only dilute an otherwise perfect match. Conversely, exploratory research — “what does this corpus say about maritime insurance,” without a specific phrase in mind — is often better served by semantic-only search, since a lexical ranking will silently miss every passage that discusses the concept using different words.

Limitations

Hybrid search inherits the weaknesses of both engines it fuses, not just their strengths: if neither BM25 nor the embedding model handles a particular script or historical spelling well, fusing their rankings will not invent a signal that was never there in either input. Fusion also adds a layer of indirection between a researcher’s intuition and the ranking they see — if a hybrid result looks wrong, diagnosing why means checking each engine’s ranking separately via the toggle, rather than reading one transparent score.

Not to be confused with

The “hybrid” extraction strategy described in OCR vs VLM: when to pick what — running classical OCR by default and a vision-language model only on low-confidence regions — is a different use of the same word. That hybrid combines two extraction engines to produce one text; this hybrid combines two search rankings over already-extracted text. Both apply “use two tools and combine them rather than pick one,” but at different pipeline stages.

Bottom line

Hybrid search fuses a literal, exact-match ranking with a meaning-based ranking into one result list, so a researcher does not have to choose in advance whether their query needs precision or recall — it is the sensible default for general queries, with the lexical and semantic toggles available for the cases where one engine alone is clearly the better tool.

FAQ

Frequently asked questions

Is hybrid search the default search mode in Archēglyph?
Yes. The Lexical | Hybrid | Semantic toggle on the search box defaults to Hybrid, which fuses the lexical (Tantivy BM25) and semantic (zvec cosine) rankings with reciprocal rank fusion. Either engine alone is one click away via the toggle.
When should I switch off hybrid search and use lexical or semantic alone?
Use lexical-only for an exact phrase, citation format, or unusually spelled proper noun, where a semantic ranking with no strong opinion about the string can only dilute a perfect match. Use semantic-only for exploratory research where you don't have a specific phrase in mind and want passages about a concept regardless of wording.

Related terms

References

← Back to the glossary