Qdrant local test: how payload filters change vector search

Qdrant can combine vector similarity with filters on fields stored alongside each vector. We verified how that changes the returned records using four synthetic support tickets and Qdrant’s Python client in local memory mode. The closest match belonged to the wrong team until we applied a team filter.

Test scope. Qdrant Python client 1.20.0, one local collection, two dimensional hand-written vectors, cosine similarity, query [1.0, 0.0], and a maximum of two results per query. The results show which synthetic records each filter returned and their cosine scores.

What we observed

Observed results (up to two matches per query)
FilterReturned IDs in orderCosine scores
None10, 201.0000, 0.9798
Team is green20, 300.9798, 0.9023
Team is green and status is open30, 400.9023, 0.8000
Team is orangeNo matches—

Ticket 10 was the closest by vector alone. Filtering for the green team put its closed ticket 20 first. Adding the open status requirement removed ticket 20 and brought ticket 40 into the second position. A deliberately absent team returned nothing, which is a useful negative case for a retrieval evaluation.

Run the same example

In an isolated Python environment, install qdrant-client==1.20.0 and run the code below. The four records and their vectors are included.

Show the complete Python script
from importlib.metadata import version

from qdrant_client import QdrantClient, models

client = QdrantClient(":memory:")
collection = "synthetic_tickets"
client.create_collection(
    collection,
    vectors_config=models.VectorParams(size=2, distance=models.Distance.COSINE),
)
tickets = [
    (10, [1.00, 0.00], "blue", "open"),
    (20, [0.98, 0.20], "green", "closed"),
    (30, [0.90, 0.43], "green", "open"),
    (40, [0.80, 0.60], "green", "open"),
]
client.upsert(
    collection,
    [models.PointStruct(id=i, vector=v, payload={"team": t, "status": s})
     for i, v, t, s in tickets],
)

def match(field, value):
    return models.FieldCondition(key=field, match=models.MatchValue(value=value))

def query(*conditions):
    query_filter = models.Filter(must=list(conditions)) if conditions else None
    hits = client.query_points(
        collection_name=collection, query=[1.0, 0.0],
        query_filter=query_filter, limit=2, with_payload=True,
    ).points
    return [(p.id, p.payload["team"], p.payload["status"], round(p.score, 4)) for p in hits]

cases = [
    ("All tickets", ()),
    ("Team green", (match("team", "green"),)),
    ("Team green and open", (match("team", "green"), match("status", "open"))),
    ("Unknown team", (match("team", "orange"),)),
]
print("qdrant-client", version("qdrant-client"))
for label, conditions in cases:
    print(label, query(*conditions), sep=": ")
client.close()

What to verify on a real corpus

Use a labelled query set with expected results and deliberately include records with similar content that the current user should never receive. Enforce eligibility in the application or service that issues the query and test denials independently. For server deployments, Qdrant recommends indexing the payload fields used in dense search filters before ingesting data. Record indexing time, recall at your chosen cutoff and query latency at your expected collection size and filter selectivity.

This is a narrow follow-up to our earlier Qdrant overview. It adds an original result for filtering and a method readers can reproduce. See how we label review evidence.

Sources and further reading