flush()
This operation flushes the streaming data and seals segments. It is recommended to call this operation after all the data has been inserted into a collection.
Request Syntax
flush(
self,
collection_name: str,
timeout: Optional[float] = None,
**kwargs,
)
PARAMETERS:
collection_name (str) -
The name of the target collection.
timeout (Optional[float]) -
The timeout duration for this operation.
Setting this to None indicates that this operation timeouts when any response arrives or any error occurs.
RETURN TYPE:
NoneType
RETURNS:
None
EXCEPTIONS:
MilvusException
This exception will be raised when any error occurs during this operation, especially when the specified alias does not exist.
Example
from pymilvus import MilvusClient
# 1. Create a milvus client
client = MilvusClient(
uri="http://localhost:19530",
token="root:Milvus"
)
client.flush(
collection_name="collection_name"
)