Skip to content

Semantic Search

Key idea:

Semantic search — document search by meaning of the query, not by keyword match. Principle: embed query + doc into vectors → cosine similarity → top-k closest docs. Understands synonyms ("car" ≈ "automobile"), conceptual links ("how to fix engine" → docs on motor troubleshooting). Traditional BM25/TF-IDF is keyword-only. Hybrid search: sparse (BM25) + dense (embeddings) + rerank — 2026 best practice.

Below: details, example, related terms, FAQ.

Try it now — free →

Details

  • Query: "how to setup SSL nginx" → embedding → search
  • Hybrid: weighted combination of BM25 score + cosine similarity
  • Rerank: top-50 retrieved → Cohere/Voyage rerank → top-5 final
  • Pre-filter: metadata (date, category, lang) narrows the search space
  • Challenges: short queries, multi-hop reasoning (need chain), multilingual

Example

# Hybrid search with Qdrant
curl -X POST http://localhost:6333/collections/docs/points/search/batch \
  -d '{
    "searches": [
      {"vector": {"name": "dense", "vector": [...]}, "limit": 50},
      {"vector": {"name": "sparse", "vector": {"indices": [...], "values": [...]}}, "limit": 50}
    ]
  }'

Related Terms

Learn more

Frequently Asked Questions

Is keyword search deprecated?

No. BM25 is great for exact matches (code, names, rare words). Hybrid (sparse + dense) beats either alone.

Elasticsearch vs Qdrant?

Elasticsearch: mature, king of sparse search, added vector in 8+. Qdrant: dense-first, fast Rust. For hybrid — Elasticsearch+vector extension or Weaviate natively.

Latency target?

<100ms for interactive search. HNSW ANN index helps, no full scan. Fine at >1M docs.