创建、删除分区

本页提供创建或删除分区的 Python 示例代码。

创建分区

你可以通过标签将集合分割为若干个分区,从而提高搜索效率。每个分区实际上也是一个集合。

# 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);

删除分区

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