Skip to content

Commit 3eaf925

Browse files
committed
fixed metadata merging to properly update the meta key
1 parent 115eff4 commit 3eaf925

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • integrations/qdrant/src/haystack_integrations/document_stores/qdrant

integrations/qdrant/src/haystack_integrations/document_stores/qdrant/document_store.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,11 @@ def update_by_filter(self, filters: dict[str, Any], meta: dict[str, Any]) -> int
651651
# update payload for each record
652652
for record in records:
653653
# merge existing payload with new metadata
654-
updated_payload = {**(record.payload or {}), **meta}
654+
# Metadata is stored under the "meta" key in the payload
655+
updated_payload = dict(record.payload or {})
656+
if "meta" not in updated_payload:
657+
updated_payload["meta"] = {}
658+
updated_payload["meta"].update(meta)
655659

656660
# create updated point preserving vectors
657661
# Type cast needed because record.vector type doesn't include all PointStruct vector types
@@ -731,7 +735,11 @@ async def update_by_filter_async(self, filters: dict[str, Any], meta: dict[str,
731735
# update payload for each record
732736
for record in records:
733737
# merge existing payload with new metadata
734-
updated_payload = {**(record.payload or {}), **meta}
738+
# Metadata is stored under the "meta" key in the payload
739+
updated_payload = dict(record.payload or {})
740+
if "meta" not in updated_payload:
741+
updated_payload["meta"] = {}
742+
updated_payload["meta"].update(meta)
735743

736744
# create updated point preserving vectors
737745
# Type cast needed because record.vector type doesn't include all PointStruct vector types

0 commit comments

Comments
 (0)