milvus-logo
LFAI
< Docs
  • Python

has_index()

This method verifies if a specified index exists.

Invocation

has_index(timeout=None)

Parameters

ParameterDescriptionTypeRequired
timeoutAn optional duration of time in seconds to allow for the RPC. If it is set to None, the client keeps waiting until the server responds or error occurs.FloatFalse
index_nameIf not specified, the default value of index_name is "_default_idx_".StringFalse

Return

A boolean value that indicates if the index exists.

Raises

  • CollectionNotExistException: error if the collection does not exist.

Example

from pymilvus import Collection
collection = Collection("book")      # Get an existing collection.
collection.has_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?