Restrict Qdrant legacy scroll filter to specific workspace

- Switch filter from `should` to `must`
- Remove `IsNullCondition` for workspace
- Enforce strict workspace ID matching
This commit is contained in:
yangdx
2025-12-19 23:41:14 +08:00
parent c1ed2e31f8
commit 93ea50c4aa

View File

@@ -295,12 +295,7 @@ class QdrantVectorDBStorage(BaseVectorStorage):
legacy_scroll_filter = None
if has_workspace_field:
legacy_scroll_filter = models.Filter(
should=[
workspace_filter_condition(workspace),
models.IsNullCondition(
is_null=models.PayloadField(key=WORKSPACE_ID_FIELD)
),
]
must=[workspace_filter_condition(workspace)]
)
# Recount with workspace filter for accurate migration tracking
legacy_count = client.count(