Create and Drop a Partition

This article provides Python sample codes for creating or dropping partitions.

Create a partition

To improve search efficiency, you can divide a collection into several partitions by tags. In fact, each partition is a collection.

# Create a partition.
>>> client.create_partition('demo_films', 'American')
// Here we create a partition called "American"
// because the films to insert are American films.
final String partitionTag = "American";
client.createPartition(collectionName, partitionTag);

Drop a partition

>>> client.drop_partition(collection_name='demo_films', partition_tag='American')
client.dropPartition(collectionName, partitionTag);
Edit
© 2019 - 2020 Milvus. All rights reserved.