# A local Qdrant filter and persistence check

On October 15, 2026, we used qdrant-client 1.19.1 and Python 3.12.13 on Windows 11. `QdrantClient(path=...)` ran in local, disk-backed mode; we did **not** start the Qdrant server, use a cloud account, load an embedding model or generate vectors from text. Four hand-set three-dimensional vectors were stored in one Dot-distance collection:

| Point | Tenant | Status | Vector |
| --- | --- | --- | --- |
| 1 | alpha | published | `[1, 0, 0]` |
| 2 | beta | published | `[0.99, 0.01, 0]` |
| 3 | alpha | withdrawn | `[0.98, 0.02, 0]` |
| 4 | alpha | published | `[0.8, 0.2, 0]` |

The query vector was `[1, 0, 0]`. We wrote the expected IDs before executing: unfiltered `[1, 2, 3, 4]`; `tenant=alpha AND status=published` `[1, 4]`; `tenant=beta AND status=published` `[2]`. After deleting point 1 with `wait=True`, alpha/published should become `[4]` and remain `[4]` after closing and reopening the disk path. A two-dimensional query should be rejected by the three-dimensional collection. The [result table](results.csv) records the observations.

The filter used `models.Filter(must=[models.FieldCondition(key="tenant", match=models.MatchValue(value="alpha")), models.FieldCondition(key="status", match=models.MatchValue(value="published"))])` with `client.query_points(..., query_filter=filter)`. Deletion used `client.delete(..., points_selector=models.PointIdsList(points=[1]), wait=True)`.

This tests the local client's filter and disk persistence, not an HTTP server, tenant authentication, application-level mandatory-filter enforcement, backup restoration, real embedding quality, recall, throughput or a production corpus. Unfiltered cross-tenant results are expected when the caller omits a filter; they are **not** proof of a Qdrant security vulnerability. The application must attach the correct authorization condition.

References: [Qdrant client local mode](https://qdrant.tech/documentation/frameworks/langchain/#local-mode), [payload filtering](https://qdrant.tech/documentation/quickstart/#add-a-filter), [open-source repository](https://github.com/qdrant/qdrant), [code license](https://github.com/qdrant/qdrant/blob/master/LICENSE).

Reproduction note: on October 16, 2026, a fresh isolated environment installed the same pinned dependencies offline and reproduced all six checks. Fresh installation/command/exit-code logs are archived separately; the October 15 records were not backfilled.

## 中文方法说明

2026 年 10 月 15 日，我们在 Windows 11、Python 3.12.13 独立环境中使用 qdrant-client 1.19.1 的 `QdrantClient(path=...)` 磁盘本地模式，没有启动 Qdrant 服务端、云账户或嵌入模型。2026 年 10 月 16 日从相同锁文件离线重建环境复跑，下面六项结果一致。新日志按新日期保存，不冒充原试验日志。

### 输入与验收规则

四条虚构记录使用三维手工向量和 Dot 距离，查询向量固定为 `[1, 0, 0]`。

| ID | 租户 | 发布状态 | 手工向量 |
| --- | --- | --- | --- |
| 1 | alpha | published | `[1, 0, 0]` |
| 2 | beta | published | `[0.99, 0.01, 0]` |
| 3 | alpha | withdrawn | `[0.98, 0.02, 0]` |
| 4 | alpha | published | `[0.8, 0.2, 0]` |

| 检查 | 预先确定且实际得到的结果 |
| --- | --- |
| 不加过滤 | `[1, 2, 3, 4]` |
| `tenant=alpha AND status=published` | `[1, 4]` |
| `tenant=beta AND status=published` | `[2]` |
| 删除 ID 1 并等待完成 | alpha/published 查询变成 `[4]` |
| 关闭后重开相同磁盘目录 | 仍为 `[4]` |
| 向三维集合发送二维查询 | 抛出 `ValueError`，没有接受错误维度 |

过滤通过 `models.Filter(must=[...])` 同时附加租户与状态条件，传给 `query_points(..., query_filter=...)`；删除使用 `PointIdsList(points=[1])` 和 `wait=True`。完整观察见[结果 CSV](results.csv)。

无过滤时跨租户返回是调用方没有加条件的预期结果，不是 Qdrant 安全漏洞的证明。应用仍需验证调用者身份并强制附加正确条件。本试验只检查本地客户端的筛选、删除、重开目录与维度行为，不证明 HTTP 鉴权、备份恢复、集群、生产持久性、真实文本召回率或吞吐性能。
