| 元数据 | 部门 / 密级 / 生效日期 / 文档类型 / 版本 |
|---|---|
| 时机 | pre-filter(先过滤再检索)优于 post-filter(检索后再筛) |
| 风险 | post-filter 会稀释 top-k,过滤后可能剩不到几条 |
| 权限 | 过滤条件是硬约束,不能交给模型判断 |
Qdrant 过滤检索
Qdrant 过滤检索
POST /collections/kb/points/search
{
"vector": [0.1, 0.2, "..."],
"limit": 10,
"filter": {
"must": [
{ "key": "dept", "match": { "value": "finance" } },
{ "key": "status", "match": { "value": "effective" } }
]
}
}过滤条件必须由后端从登录态推导,绝不能接受前端传入的部门/密级参数——那是越权的直接入口。