跳到主要内容

get_compaction_plans()

Addedv2.6.x

This operation returns the compaction plans for a specific compaction job, including the merge plans showing which segments will be combined.

📘Notes

This only applies to managed collections.

Request syntax

client.get_compaction_plans(
job_id: int,
timeout: float = None
) -> CompactionPlans

PARAMETERS:

  • job_id (int) -

    [REQUIRED]

    The ID of the compaction job returned by compact().

  • timeout (float | None) -

    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:

CompactionPlans

EXCEPTIONS:

  • MilvusException

    This exception will be raised when any error occurs during this operation.

Example

from pymilvus import MilvusClient

client = MilvusClient(
uri="https://{cluster-id}.{region}.vectordb.zilliz.com.cn:19530",
token="YOUR_CLUSTER_TOKEN"
)

job_id = client.compact(collection_name="my_collection")
plans = client.get_compaction_plans(job_id=job_id)
print(plans)