milvus-logo

compact()

This method compacts data by merging small segments in a collection in Milvus.

Invocation

compact(collection_name, timeout=None, **kwargs):

Parameters

ParameterDescriptionTypeRequired
collection_nameName of the collection to to compact.StringTrue
timeoutAn optional duration of time in seconds to allow for the RPC. If it is set to None, the client keeps waiting until the server responds or error occurs.FloatFalse

Return

No return.

Raises

  • BaseException: error if the collection does not exist.

Example

from pymilvus import Collection
collection = Collection("book")      # Get an existing collection.
collection.compact()