WIP Phase 4 ingestion: platform guides, exclusion gate, gitea/vault/graph harvest, payload provenance
This commit is contained in:
@@ -198,6 +198,8 @@ class Qdrant:
|
||||
limit: int = 5,
|
||||
area: str = None,
|
||||
confidence: str = None,
|
||||
platform: str = None,
|
||||
tier: int = None,
|
||||
with_payload: bool = True,
|
||||
) -> list:
|
||||
"""Nearest neighbours, optionally filtered *before* the search."""
|
||||
@@ -206,7 +208,7 @@ class Qdrant:
|
||||
"limit": int(limit),
|
||||
"with_payload": bool(with_payload),
|
||||
}
|
||||
filters = _filter_conditions(area, confidence)
|
||||
filters = _filter_conditions(area, confidence, platform, tier)
|
||||
if filters:
|
||||
body["filter"] = {"must": filters}
|
||||
try:
|
||||
@@ -260,10 +262,16 @@ class QdrantNotFound(QdrantError):
|
||||
"""A 404 from Qdrant: the collection or route does not exist."""
|
||||
|
||||
|
||||
def _filter_conditions(area: str = None, confidence: str = None) -> list:
|
||||
def _filter_conditions(
|
||||
area: str = None, confidence: str = None, platform: str = None, tier: int = None
|
||||
) -> list:
|
||||
conditions = []
|
||||
if area:
|
||||
conditions.append({"key": "area", "match": {"value": area}})
|
||||
if confidence:
|
||||
conditions.append({"key": "confidence", "match": {"value": confidence}})
|
||||
if platform:
|
||||
conditions.append({"key": "platform", "match": {"value": platform}})
|
||||
if tier is not None:
|
||||
conditions.append({"key": "tier", "match": {"value": int(tier)}})
|
||||
return conditions
|
||||
|
||||
Reference in New Issue
Block a user