- Range / Threshold Search (quality-first filtering)
- Multi-Vector Search (multimodal queries)
- Approximate Nearest Neighbor (ANN) Search (scale and latency)
- Two-Stage Search (retrieve-and-rerank for both speed and accuracy)
Range / Threshold Search
Range or threshold search filters results by a minimum similarity score rather than returning a fixed number of neighbors. Use this when you care about the absolute quality of each match instead of the top-K set. When to use it- You require high-confidence matches (not simply the top-k results).
- Correctness and compliance matter (e.g., legal, regulatory, or safety checks).
- You want deterministic filtering across different queries and model versions.
- Plagiarism detection: return all documents with similarity > 0.85 to a submitted paper.
- Fraud detection: flag transactions with similarity > 0.9 against known fraudulent patterns.
Thresholds are a filtering step. Choose them based on validation data: too low yields noise, too high may miss valid matches.
- Generic threshold pseudocode:
- API-style:
Multi-Vector Search (Multimodal Queries)
Multi-vector search is for queries that combine different input types (text, image, audio). Each modality gets encoded to its own vector and the system merges or scores them jointly to find items that satisfy multiple signals. When to use it- User queries include mixed modalities (e.g., image + text).
- You need results that match several signals simultaneously (visual features + textual intent).
- Cross-modal relevance is critical for user experience.
- E-commerce: upload an image of a dress and type “red dress for summer” — the system merges image and text vectors to find matching inventory.
- Social media search: combine uploaded image, caption text, and hashtag vectors to surface relevant posts.

- Fusion strategies include weighted dot-product sums, concatenation with a learned MLP, or late fusion via re-ranking.
- Tune modality weights based on validation metrics and user intent: e.g., if visual similarity is more important, raise image weight.
Approximate Nearest Neighbor (ANN) Search
Approximate Nearest Neighbor (ANN) search is optimized for extremely large vector stores (millions to billions of vectors) where sub-second latency is required. ANN uses indexing structures and heuristics to return very likely nearest neighbors far faster than an exhaustive exact KNN scan, at a controlled loss in recall. When to use it- Very large datasets (millions–billions of vectors).
- Real-time or low-latency applications where slight accuracy trade-offs are acceptable.
- Services where throughput and fast tail latency are primary constraints.
- Web-scale search (e.g., search engines): serving billions of documents with strict latency SLOs.
- Recommendation systems at scale (Spotify, Pinterest) where fast retrieval across massive catalogs is required.

- ANN provides massive speedups but may reduce recall. Tune index parameters (e.g., number of probes, ef_search, M) to balance latency vs. accuracy.
- Monitor recall/precision on labeled queries to guide the acceptable operating point.
ANN is a trade-off: optimize index parameters and measure recall on real query workloads. A misconfigured ANN index can silently degrade user experience.
Two-Stage Search (Retrieve-and-Rerank)
Two-stage search (retrieve-and-rerank) mixes a fast retrieval stage with a more expensive re-ranking stage. Typically you use an ANN or lightweight vector index to fetch a candidate set, then apply a stronger cross-encoder or business-logic-aware model to re-rank the candidates. When to use it- You need both low latency and high final ranking quality.
- Ranking must incorporate complex signals: recency, personalization, seller priorities, or business rules.
- The quality of the top results (e.g., top 10) is critical to user satisfaction.
- Search engines: retrieve ~1000 candidates with ANN, rerank the top subset using a cross-encoder, and display the best ~10 results.
- E-commerce: retrieve product candidates, then rerank by personalization, conversion likelihood, and business constraints.
- Keeps initial retrieval cheap and scalable.
- Allows sophisticated models to focus on a much smaller candidate set, improving final relevance without prohibitive cost.

- Stage 1 (fast): ANN -> 1,000 candidates
- Stage 2 (expensive): cross-encoder or ensemble model -> rerank top 100 -> final top 10
Comparison Table
| Query Method | Best For | Pros | Cons | Example Use Cases |
|---|---|---|---|---|
| Range / Threshold Search | High-confidence filtering | Deterministic quality control, simple | May return variable counts, sensitive to threshold | Plagiarism, compliance checks |
| Multi-Vector Search | Multimodal queries | Captures multiple modalities, richer relevance | More complex encoding/fusion | Image+text e-commerce, multimodal social search |
| ANN Search | Very large scale, low latency | Extremely fast, scalable | Potential recall loss; requires tuning | Web search, large recommenders |
| Two-Stage (Retrieve & Rerank) | Speed + high-quality ranking | Balances latency and top-result quality | More complex pipeline, higher cost | Search engines, conversion-optimized e-commerce |
Summary — Choosing the Right Strategy
- Range / Threshold: Use when you must enforce a strict quality bar for each returned item.
- Multi-Vector: Use when user intent spans multiple modalities and you need joint relevance.
- ANN: Use for massive datasets and strict latency requirements where a small accuracy trade-off is acceptable.
- Two-Stage (Retrieve-and-Rerank): Use when you need both fast retrieval and the highest-quality top results incorporating complex signals.