milvus-logo

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")