Fix Milvus DataNotMatchException

This commit is contained in:
xuewei 2025-07-16 21:59:17 +08:00
parent bd340fece6
commit e0bb6093b0
2 changed files with 3 additions and 2 deletions

View file

@ -457,13 +457,13 @@ class LightRAG:
namespace=NameSpace.VECTOR_STORE_ENTITIES,
workspace=self.workspace,
embedding_func=self.embedding_func,
meta_fields={"entity_name", "source_id", "content", "file_path"},
meta_fields={"entity_name", "source_id", "content", "file_path", "entity_type"},
)
self.relationships_vdb: BaseVectorStorage = self.vector_db_storage_cls( # type: ignore
namespace=NameSpace.VECTOR_STORE_RELATIONSHIPS,
workspace=self.workspace,
embedding_func=self.embedding_func,
meta_fields={"src_id", "tgt_id", "source_id", "content", "file_path"},
meta_fields={"src_id", "tgt_id", "source_id", "content", "file_path", "weight"},
)
self.chunks_vdb: BaseVectorStorage = self.vector_db_storage_cls( # type: ignore
namespace=NameSpace.VECTOR_STORE_CHUNKS,

View file

@ -1284,6 +1284,7 @@ async def merge_nodes_and_edges(
"content": f"{edge_data['src_id']}\t{edge_data['tgt_id']}\n{edge_data['keywords']}\n{edge_data['description']}",
"source_id": edge_data["source_id"],
"file_path": edge_data.get("file_path", "unknown_source"),
"weight": 0
}
}
await relationships_vdb.upsert(data_for_vdb)