Class Index

Methods

checkCollectionAndPartitionName

  • Parameters

    • data: any

    Returns void

checkCollectionName

  • Parameters

    • data: any

    Returns void

createIndex

  • Create an index on a vector field. Note that index building is an async progress.

    Parameters

    • data: CreateIndexReq
      Property Type Description
      collection_name String Collection name
      field_name String Field name
      extra_params Object Parameters: { index_type: string; metric_type: string; params: string; };

    Returns Promise<ResStatus>

    Property Description
    error_code Error code number
    reason Error cause

    Example

     new milvusClient(MILUVS_ADDRESS).collectionManager.createIndex({
        collection_name: 'my_collection',
        field_name: "vector_01",
        extra_params: {
          index_type: "IVF_FLAT",
          metric_type: "IP",
          params: JSON.stringify({ nlist: 10 }),
        },
     });
    

describeIndex

  • Show index information. Current release of Milvus only supports showing latest built index.

    Parameters

    • data: DescribeIndexReq
      Property Type Description
      collection_name String Collection name

    Returns Promise<DescribeIndexResponse>

    Property Description
    status { error_code: number, reason: string }
    index_descriptions Index information

    Example

     new milvusClient(MILUVS_ADDRESS).indexManager.describeIndex({
        collection_name: 'my_collection',
     });
    

dropIndex

  • Drop an index.

    Parameters

    • data: DropIndexReq
      Property Type Description
      collection_name String Collection name

    Returns Promise<ResStatus>

    Property Description
    error_code Error code number
    reason Error cause

    Example

     new milvusClient(MILUVS_ADDRESS).indexManager.dropIndex({
        collection_name: 'my_collection',
     });
    

getIndexBuildProgress

  • Show index building progress.

    Parameters

    • data: GetIndexBuildProgressReq
      Property Type Description
      collection_name String Collection name

    Returns Promise<GetIndexBuildProgressResponse>

    Property Description
    status { error_code: number, reason: string }
    indexed_rows Row count that successfully built with index
    total_rows Total row count

    Example

     new milvusClient(MILUVS_ADDRESS).indexManager.getIndexBuildProgress({
        collection_name: 'my_collection',
     });
    

getIndexState

  • Show index building state.

    Parameters

    • data: GetIndexStateReq
      Property Type Description
      collection_name string Collection name

    Returns Promise<GetIndexStateResponse>

    Property Description
    status { error_code: number, reason: string }
    state Index building state

    Example

     new milvusClient(MILUVS_ADDRESS).indexManager.getIndexState({
        collection_name: 'my_collection',
     });