useful-notes/hqew/010-search-and-vector-query-engines.md
2026-04-01 13:52:34 +02:00

105 lines
2.3 KiB
Markdown

# Search and Vector Query Engines
A reference for how search-oriented engines differ from classical relational ones.
---
## Short answer
Search and vector engines are still query engines, but their core operators, indexes, and ranking models differ from standard relational SQL systems.
They are often built around retrieval rather than exact relational transformation.
---
## Search engines
Traditional search engines center on:
- inverted indexes
- document retrieval
- ranking and scoring
- boolean and text queries
The core question is often not just "which rows satisfy a predicate?" but "which documents are most relevant?"
That makes ranking a first-class part of execution.
---
## Vector engines
Vector engines center on:
- embeddings
- nearest-neighbor search
- approximate similarity retrieval
- metadata filtering
The core operation is often "find the closest vectors to this query vector," which is different from equality joins or exact predicate evaluation.
Approximation is often acceptable because speed matters and exact nearest-neighbor search can be too expensive at scale.
---
## Hybrid systems
Many modern systems combine:
- lexical search
- vector search
- metadata filters
- reranking
This means the engine may need to merge several candidate-generation and scoring paths into one final result.
---
## How these engines differ from relational ones
Search and vector engines often emphasize:
- ranking
- retrieval quality
- approximate indexing
- candidate generation
- top-k execution
Relational engines more often emphasize:
- exact semantics
- joins
- aggregations
- transactional or analytical correctness
The difference is not that one has a query engine and the other does not. The difference is what the engine is optimizing for.
---
## Example systems
Examples of search and vector query engines include:
- Lucene
- Vespa
- Weaviate
- Qdrant
They differ in packaging and scope, but all have real planning and execution concerns around retrieval.
---
## Practical mental model
Relational engines are often about exact transformation of structured data.
Search and vector engines are often about efficient retrieval and ranking over high-dimensional or text-heavy data.
That is the cleanest conceptual distinction.
---
## Changelog
* **April 1, 2026** -- First version created.