Artificial Intelligence

Vector Databases and Semantic Search: Getting to Know Qdrant and Elasticsearch

Semantic search finds documents by meaning, not just matching words. Learn about embeddings, the HNSW algorithm, and when to use Qdrant or Elasticsearch.

By Oemah Solution Editorial 2 min read
Rows of wooden card catalog cabinets with many drawers in a library room
Photo: Copyright Card Catalog Files by Michael Holley Swtpc6800 · Public domain · Wikimedia Commons

Traditional search matches words. If a user types "how to replace a lost driving licence", a document titled "Procedure for reissuing a driver's permit" may be missed because the words are different. Semantic search solves this by searching by meaning.

Embeddings: meaning as vectors

An embedding model turns text (or images) into a high-dimensional list of numbers. Texts with similar meanings have vectors that are close together. Closeness is measured with metrics such as cosine similarity or the dot product.

Searching millions of vectors quickly

Comparing a query vector with every document vector one by one is too slow on large datasets. That is why Approximate Nearest Neighbor (ANN) search is used. One of the most popular algorithms is HNSW (Hierarchical Navigable Small World), introduced by Malkov and Yashunin. HNSW builds a layered graph so a search can "jump" quickly towards the nearest neighbours with high accuracy.

Qdrant

Qdrant is an open-source vector database designed specifically for storing and searching vectors. Its key features include HNSW indexing, payload filtering (for example restricting results by category, region or access rights), multiple vectors per object, and quantisation to save memory. Qdrant fits when vector search is the primary requirement, such as in RAG or recommendation systems.

Elasticsearch

Elasticsearch is known as a full-text search engine with BM25 ranking, aggregations and log analytics. Elasticsearch also supports the dense_vector type and kNN search, so keyword and semantic search can be combined in one system (hybrid search). This suits organisations that already run text-search infrastructure and want to add semantic capabilities.

Choosing an approach

  • Vector search & RAG are the main need → a dedicated vector database such as Qdrant.
  • Text search, complex filters and analytics already dominate → Elasticsearch with kNN.
  • Lots of specific terms (case numbers, product codes, names) → use hybrid search, whichever platform you choose.

Whatever you choose, result quality depends heavily on the embedding model, the document chunking strategy, and evaluation with real user questions.

#vector database#qdrant#elasticsearch#semantic search

Sources & references

This article is a summary and interpretation by the Oemah Solution team of the sources below. Refer to the original sources for full details and context.

  1. Efficient and robust approximate nearest neighbor search using HNSW graphs (Malkov & Yashunin) arXiv · arxiv.org
  2. Qdrant Documentation Qdrant · qdrant.tech
  3. kNN search in Elasticsearch Elastic · elastic.co