Fix Milvus DataNotMatchException
This commit is contained in:
parent
bd340fece6
commit
e0bb6093b0
2 changed files with 3 additions and 2 deletions
|
|
@ -457,13 +457,13 @@ class LightRAG:
|
||||||
namespace=NameSpace.VECTOR_STORE_ENTITIES,
|
namespace=NameSpace.VECTOR_STORE_ENTITIES,
|
||||||
workspace=self.workspace,
|
workspace=self.workspace,
|
||||||
embedding_func=self.embedding_func,
|
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
|
self.relationships_vdb: BaseVectorStorage = self.vector_db_storage_cls( # type: ignore
|
||||||
namespace=NameSpace.VECTOR_STORE_RELATIONSHIPS,
|
namespace=NameSpace.VECTOR_STORE_RELATIONSHIPS,
|
||||||
workspace=self.workspace,
|
workspace=self.workspace,
|
||||||
embedding_func=self.embedding_func,
|
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
|
self.chunks_vdb: BaseVectorStorage = self.vector_db_storage_cls( # type: ignore
|
||||||
namespace=NameSpace.VECTOR_STORE_CHUNKS,
|
namespace=NameSpace.VECTOR_STORE_CHUNKS,
|
||||||
|
|
|
||||||
|
|
@ -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']}",
|
"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"],
|
"source_id": edge_data["source_id"],
|
||||||
"file_path": edge_data.get("file_path", "unknown_source"),
|
"file_path": edge_data.get("file_path", "unknown_source"),
|
||||||
|
"weight": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await relationships_vdb.upsert(data_for_vdb)
|
await relationships_vdb.upsert(data_for_vdb)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue