milvus-logo
LFAI
< Docs
  • Java

createPartition()

This operation creates a partition in the target collection.

public void createPartition(CreatePartitionReq request)

Request Syntax

createPartition(CreatePartitionReq.builder()
    .collectionName(String collectionName)
    .partitionName(String partitionName)
    .build()
)

BUILDER METHODS:

  • collectionName(String collectionName)

    (Required) The name of an existing collection.

  • partitionName(String partitionName)

    (Required) The name of the partition to create.

RETURNS:

void

EXCEPTIONS:

  • MilvusClientExceptions

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

Example

// create a partition "test_partition" in collection "test"
CreatePartitionReq createPartitionReq = CreatePartitionReq.builder()
        .collectionName("test")
        .partitionName("test_partition")
        .build();
client.createPartition(createPartitionReq);

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?