mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-31 15:47:05 +00:00
fix issue2321:Provide an implementation of the truncate method
This commit is contained in:
parent
1a6ad50b3d
commit
69a20c3e7e
@ -638,3 +638,15 @@ class MilvusStore(VectorStoreBase):
|
||||
else:
|
||||
metadata_filter_expr = metadata_filters[0]
|
||||
return metadata_filter_expr
|
||||
|
||||
def truncate(self):
|
||||
"""Truncate milvus collection.
|
||||
"""
|
||||
logger.info(f"begin truncate milvus collection:{self.collection_name}")
|
||||
from pymilvus import utility
|
||||
if utility.has_collection(self.collection_name):
|
||||
utility.drop_collection(self.collection_name)
|
||||
|
||||
logger.info(
|
||||
f"truncate milvus collection {self.collection_name} success"
|
||||
)
|
Loading…
Reference in New Issue
Block a user