milvus-logo
LFAI
< Docs
  • Python

index()

This method gets the index object in the collection.

Invocation

index()

Parameters

ParameterDescriptionTypeRequired
index_nameIf not specified, the default value of index_name is "_default_idx_".StringFalse

Return

The index object.

Raises

  • CollectionNotExistException: error if the collection does not exist.
  • BaseException: error if the specified partition does not exist.

Example

from pymilvus import Collection
collection = Collection("book")      # Get an existing collection.
collection.index(index_name="vec_index")

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?