mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-11 13:59:04 +08:00
fix mivlus delete by ids error (#2573)
Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
parent
0c0e96c55f
commit
fc64cdee64
@ -7,4 +7,4 @@ class Field(Enum):
|
||||
GROUP_KEY = "group_id"
|
||||
VECTOR = "vector"
|
||||
TEXT_KEY = "text"
|
||||
PRIMARY_KEY = " id"
|
||||
PRIMARY_KEY = "id"
|
||||
|
@ -124,7 +124,12 @@ class MilvusVector(BaseVector):
|
||||
|
||||
def delete_by_ids(self, doc_ids: list[str]) -> None:
|
||||
|
||||
self._client.delete(collection_name=self._collection_name, pks=doc_ids)
|
||||
result = self._client.query(collection_name=self._collection_name,
|
||||
filter=f'metadata["doc_id"] in {doc_ids}',
|
||||
output_fields=["id"])
|
||||
if result:
|
||||
ids = [item["id"] for item in result]
|
||||
self._client.delete(collection_name=self._collection_name, pks=ids)
|
||||
|
||||
def delete(self) -> None:
|
||||
alias = uuid4().hex
|
||||
|
Loading…
x
Reference in New Issue
Block a user