Class Index

Methods

createIndex

  • Create index on vector field, it will be async progress.

    Parameters

    • data: CreateIndexReq
      Property Type Description
      collection_name string collection name
      field_name string field name
      extra_params CreateIndexParam[] parameters: {key: "index_type" | "metric_type" | "params";value:string}

    Returns Promise<ResStatus>

    Property Description
    error_code error code number
    reason reason

    Example

     new milvusClient(MILUVS_IP).collectionManager.createIndex({
        collection_name: 'my_collection',
        field_name: "vector_01",
    
        extra_params: [
          {
            key: "index_type",
            value: "BIN_IVF_FLAT",
          },
          {
            key: "metric_type",
            value: "HAMMING",
          },
          {
            key: "params",
            value: JSON.stringify({ nlist: 1024 }),
          },
        ],
      });
    

describeIndex

  • Get index information, only get latest index for now.

    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_IP).indexManager.describeIndex({
        collection_name: 'my_collection',
     });
    

dropIndex

  • Drop index

    Parameters

    • data: DropIndexReq
      Property Type Description
      collection_name string collection name

    Returns Promise<ResStatus>

    Property Description
    error_code error code number
    reason reason

    Example

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

getIndexBuildProgress

  • Get 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 building index success row count
    total_rows total row count

    Example

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

getIndexState

  • Get 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_IP).indexManager.getIndexState({
        collection_name: 'my_collection',
     });