I've noticed that pure semantic search sometimes misses specific product SKUs. How can I implement hybrid search in Qdrant by combining dense embeddings with sparse vectors? I want to make sure the keyword matches are prioritized alongside the conceptual similarity.
3 answers
Hybrid search is a game changer for technical datasets. In Qdrant, you can now store both dense and sparse vectors in the same point. You would use a model like BM25 or SPLADE to generate the sparse components. When querying, you send both vector types and use a fusion method, like Reciprocal Rank Fusion (RRF), to merge the results. This allows the engine to catch the exact "SKU" matches via the sparse index while still providing the "vibe" matches via the dense embeddings. It effectively solves the vocabulary gap problem that often plagues standard vector-only search engines.
Are you planning to run the sparse vector encoding on the client side or are you looking for a database-native solution?
Make sure you calibrate the weights between the dense and sparse scores, or the results might lean too heavily toward one side.
Spot on, Kevin. Finding that sweet spot for the weight ratio is the most time-consuming part of the whole hybrid search setup in my experience.
We are currently doing the encoding on our application server using a Python library. We find it gives us more control over the tokenization process, especially since our SKUs have weird alphanumeric patterns that standard BERT tokenizers sometimes struggle with. It adds a bit of latency, but the accuracy gain for our customers is worth the extra few milliseconds.