Build your own vector database
Payload filtering (the Qdrant problem)·7 min

Filtered search

0 / 1

Real queries are 'nearest vectors where category = electronics and price < 100.' Two naive strategies both fail. Post-filter (search top-k, then drop non-matches) can return nothing if the matches were outside the top-k. Pre-filter (only traverse matching nodes) fragments the graph — the matching nodes may not be connected to each other, so the greedy walk gets stranded and recall collapses.

Qdrant's answer

Traverse the full graph (so it stays connected) but only admit matching nodes into the result set W. For very selective filters, where so few points match that the graph would be useless, fall back to a filtered full scan. That is the filterable-HNSW idea — keep the graph navigable, gate only the results.

Full graph (connected) vs pre-filtered subgraph (fragmented)
full graph:        m - x - m - x - m      (m=match, x=non-match)
                   walk hops through x to reach every m  ✓

pre-filtered:      m       m       m
                   (edges through x deleted -> islands)  ✗