describeIndex()
This operation describes a specific index.
public DescribeIndexResp describeIndex(DescribeIndexReq request)
Request Syntax
describeIndex(DescribeIndexReq.builder()
.databaseName(String databaseName)
.collectionName(String collectionName)
.fieldName(String fieldName)
.indexName(String indexName)
.timestamp(Long timestamp)
.build()
);
BUILDER METHODS:
databaseName(String databaseName)-The name of the database. Defaults to the current database if not specified.
collectionName(String collectionName)-The name of the target collection.
fieldName(String fieldName)-The name of the target field.
indexName(String indexName)-The name of the target index.
timestamp(Long timestamp)-A timestamp for time-travel queries. Defaults to
0L.
RETURN TYPE:
DescribeIndexResp
RETURNS:
A DescribeIndexResp object that contains the details of the specified index.
getIndexDescriptions()(List) - The index descriptions. Each IndexDesc has the following getters:
getFieldName()(String) -The name of the field the index is built on.
getIndexName()(String) -The name of the index.
getId()(long) -The internal ID of the index.
getIndexType()(IndexType) -The type of the index. See IndexType.
getMetricType()(MetricType) -The metric type used to measure vector similarity. See MetricType.
getExtraParams()(Map) - The extra parameters of the index.
getIndexedRows()(long) -The number of rows that have been indexed.
getTotalRows()(long) -The total number of rows in the collection.
getPendingIndexRows()(long) -The number of rows waiting to be indexed.
getIndexState()(IndexBuildState) -The build state of the index.
getIndexFailedReason()(String) -The reason the index build failed, if any.
getProperties()(Map) - Deprecated. The properties of the index. Use
extraParamsinstead.
getIndexDescByFieldName(String fieldName)(IndexDesc) -Returns the index description for the specified field name, or
nullif none is found. ThrowsIllegalArgumentExceptionif the field name isnull.getIndexDescByIndexName(String indexName)(IndexDesc) -Returns the index description for the specified index name, or
nullif none is found. ThrowsIllegalArgumentExceptionif the index name isnull.
EXCEPTIONS:
MilvusClientException
This exception will be raised when any error occurs during this operation.
Example
import io.milvus.v2.client.ConnectConfig;
import io.milvus.v2.client.MilvusClientV2;
import io.milvus.v2.service.index.request.DescribeIndexReq;
import io.milvus.v2.service.index.response.DescribeIndexResp;
import java.util.Set;
// 1. Set up a client
ConnectConfig connectConfig = ConnectConfig.builder()
.uri("http://localhost:19530")
.token("root:Milvus")
.build();
MilvusClientV2 client = new MilvusClientV2(connectConfig);
// 2. Describe the index for the field "vector"
DescribeIndexReq describeIndexReq = DescribeIndexReq.builder()
.collectionName("test")
.fieldName("vector")
.build();
DescribeIndexResp describeIndexResp = client.describeIndex(describeIndexReq);