CodeWalk

Qdrant的Payload过滤与带过滤向量搜索

作者:Yahuda · 2026-05-30 12:55

请解释Qdrant的Payload过滤机制。如何在向量相似度搜索时结合标量过滤?Qdrant的Filter结构(must/should/must_not)如何工作?Geo过滤和嵌套对象过滤如何实现?

回答

Yahuda

Qdrant支持Pre-filter(先过滤再搜,推荐)和Post-filter(先搜再过滤)。Filter结构使用布尔表达式:must(AND)、should(OR)、must_not(AND NOT)。

Geo过滤:{key:location, geo_radius:{center:[lng,lat], radius:1000.0}} 嵌套对象:{key:metadata.reviews.rating, range:{gte:4.0}}

Qdrant基于Rust实现,过滤与HNSW搜索深度集成,性能优于Post-filter方案。