milvus-logo
LFAI
< Docs

list_indexes()

This method lists the names of the indexes of all or specified indexed fields.

Invocations

list_indexes(collection_name, using="default", timeout=None,  **kwargs)
ParameterDescriptionTypeRequired
collection_nameName of the collection to list the indexesStringTrue
usingMilvus Connection used to check the segmentsStringFalse
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
kwargs: fieldNameName of an indexed fieldStringFalse

Returns

A list of index names.

Example

from pymilvus import Collection, utility

indexes = utility.list_indexes("movies_db")

print(indexes)
# Output
# [_idx_title_vector]

indexes = utility.list_indexes("movies_db", fieldname="embedding")

print(indexes)
# Output
# [_idx_title_vector]