This commit is contained in:
1 parent
379cb6ff99
commit
3dcc9274fc
1 file changed
+4
-4
@@ -55,9 +55,9 @@ def points_for_chunks(
|
|||||||
|
|
||||||
def points_for_edges(prefix: str, edge_payloads: List[dict]) -> Tuple[str, List[rest.PointStruct]]:
|
def points_for_edges(prefix: str, edge_payloads: List[dict]) -> Tuple[str, List[rest.PointStruct]]:
|
||||||
"""
|
"""
|
||||||
Edges-Collection ohne Vektor.
|
Edges-Collection mit 1D-Dummy-Vektor.
|
||||||
- Pydantic/Qdrant-Client erwartet trotzdem ein 'vector'-Feld → wir setzen vector=None.
|
|
||||||
- Fehlt 'edge_id', konstruieren wir eine stabile ID aus (kind, source_id, target_id, seq).
|
- Fehlt 'edge_id', konstruieren wir eine stabile ID aus (kind, source_id, target_id, seq).
|
||||||
|
- vector=[0.0] erfüllt die Client-Validierung.
|
||||||
"""
|
"""
|
||||||
_, _, edges_col = _names(prefix)
|
_, _, edges_col = _names(prefix)
|
||||||
points: List[rest.PointStruct] = []
|
points: List[rest.PointStruct] = []
|
||||||
@@ -71,12 +71,12 @@ def points_for_edges(prefix: str, edge_payloads: List[dict]) -> Tuple[str, List[
|
|||||||
edge_id = f"{kind}:{s}->{t}#{seq}"
|
edge_id = f"{kind}:{s}->{t}#{seq}"
|
||||||
pl["edge_id"] = edge_id
|
pl["edge_id"] = edge_id
|
||||||
point_id = _to_uuid(edge_id)
|
point_id = _to_uuid(edge_id)
|
||||||
# WICHTIG: vector=None, damit der Client das Feld hat, die Collection aber vektorlos bleibt
|
points.append(rest.PointStruct(id=point_id, vector=[0.0], payload=pl))
|
||||||
points.append(rest.PointStruct(id=point_id, vector=None, payload=pl))
|
|
||||||
return edges_col, points
|
return edges_col, points
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def upsert_batch(client, collection: str, points: List[rest.PointStruct]) -> None:
|
def upsert_batch(client, collection: str, points: List[rest.PointStruct]) -> None:
|
||||||
if not points:
|
if not points:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in new issue
Block a user