# MilvusClient

Package io.milvus.client

## Interface MilvusClient

All Known Implementing Classes:
  `AbstractMilvusGrpcClient`, `MilvusMultiServiceClient`, `MilvusServiceClient`

    public interface MilvusClient

The Milvus Client Interface

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
`R<RpcStatus>` `addUserToRole​(AddUserToRoleParam requestParam)` The user will get permissions that the role are allowed to perform operations.
`R<RpcStatus>` `alterAlias​(AlterAliasParam requestParam)` Alters alias from a collection to another.
`R<RpcStatus>` `alterCollection​(AlterCollectionParam requestParam)` Alter collection with key-value properties.
`R<RpcStatus>` `alterIndex​(AlterIndexParam requestParam)` Alter index with key value properties.
`R<io.milvus.grpc.ImportResponse>` `bulkInsert​(BulkInsertParam requestParam)` Import data from external files, currently support JSON format
`R<io.milvus.grpc.CheckHealthResponse>` `checkHealth()` Check server health
`default void` `close()` Disconnects from a Milvus server with timeout of 1 minute
`void` `close​(long maxWaitSeconds)` Disconnects from a Milvus server with configurable timeout.
`R<RpcStatus>` `createAlias​(CreateAliasParam requestParam)` Creates an alias for a collection.
`R<RpcStatus>` `createCollection​(CreateCollectionParam requestParam)` Creates a collection in Milvus.
`R<RpcStatus>` `createCollection​(CreateSimpleCollectionParam requestParam)` Creates a collection in Milvus.
`R<RpcStatus>` `createCredential​(CreateCredentialParam requestParam)` Create credential using the given user and password.
`R<RpcStatus>` `createDatabase​(CreateDatabaseParam requestParam)` Creates a database in Milvus.
`R<RpcStatus>` `createIndex​(CreateIndexParam requestParam)` Creates an index on a vector field in the specified collection.
`R<RpcStatus>` `createPartition​(CreatePartitionParam requestParam)` Creates a partition in the specified collection.
`R<RpcStatus>` `createResourceGroup​(CreateResourceGroupParam requestParam)` Create a resource group.
`R<RpcStatus>` `createRole​(CreateRoleParam requestParam)` It will success if the role isn't existed, otherwise fail.
`R<io.milvus.grpc.MutationResult>` `delete​(DeleteParam requestParam)` Deletes entity(s) based on primary key(s) filtered by boolean expression.
`R<DeleteResponse>` `delete​(DeleteIdsParam requestParam)` Deletes entity(s) based on the value of primary key.
`R<RpcStatus>` `deleteCredential​(DeleteCredentialParam requestParam)` Delete credential corresponding to the user.
`R<io.milvus.grpc.DescribeCollectionResponse>` `describeCollection​(DescribeCollectionParam requestParam)` Shows the details of a collection, e.g.
`R<io.milvus.grpc.DescribeIndexResponse>` `describeIndex​(DescribeIndexParam requestParam)` Shows the information of the specified index.
`R<io.milvus.grpc.DescribeResourceGroupResponse>` `describeResourceGroup​(DescribeResourceGroupParam requestParam)` Describe a resource group.
`R<RpcStatus>` `dropAlias​(DropAliasParam requestParam)` Drops an alias for the specified collection.
`R<RpcStatus>` `dropCollection​(DropCollectionParam requestParam)` Drops a collection.
`R<RpcStatus>` `dropDatabase​(DropDatabaseParam requestParam)` Drops a database.
`R<RpcStatus>` `dropIndex​(DropIndexParam requestParam)` Drops the index on a vector field in the specified collection.
`R<RpcStatus>` `dropPartition​(DropPartitionParam requestParam)` Drops a partition.
`R<RpcStatus>` `dropResourceGroup​(DropResourceGroupParam requestParam)` Drop a resource group.
`R<RpcStatus>` `dropRole​(DropRoleParam requestParam)` It will success if the role is existed, otherwise fail.
`R<io.milvus.grpc.FlushResponse>` `flush​(FlushParam requestParam)` Flushes inserted data in buffer into storage.
`R<io.milvus.grpc.FlushAllResponse>` `flushAll​(boolean syncFlushAll, long syncFlushAllWaitingInterval, long syncFlushAllTimeout)` Flush all collections.
`R<GetResponse>` `get​(GetIdsParam requestParam)` Get entity(s) based on the value of primary key.
`R<io.milvus.grpc.GetImportStateResponse>` `getBulkInsertState​(GetBulkInsertStateParam requestParam)` Get state of bulk insert task
`R<io.milvus.grpc.GetCollectionStatisticsResponse>` `getCollectionStatistics​(GetCollectionStatisticsParam requestParam)` Shows the statistics information of a collection.
`R<io.milvus.grpc.GetCompactionStateResponse>` `getCompactionState​(GetCompactionStateParam requestParam)` Gets the compaction state by id.
`R<io.milvus.grpc.GetCompactionPlansResponse>` `getCompactionStateWithPlans​(GetCompactionPlansParam requestParam)` Gets compaction state with its plan.
`R<io.milvus.grpc.GetFlushAllStateResponse>` `getFlushAllState​(GetFlushAllStateParam requestParam)` Get flush state of all segments.
`R<io.milvus.grpc.GetFlushStateResponse>` `getFlushState​(GetFlushStateParam requestParam)` Get flush state of specified collection.
`R<io.milvus.grpc.GetIndexBuildProgressResponse>` `getIndexBuildProgress​(GetIndexBuildProgressParam requestParam)` Shows the index building progress, such as how many rows are indexed.
`R<io.milvus.grpc.GetIndexStateResponse>` `getIndexState​(GetIndexStateParam requestParam)` Shows the index building state(in-progress/finished/failed), and the reason for failure (if any).
`R<io.milvus.grpc.GetLoadingProgressResponse>` `getLoadingProgress​(GetLoadingProgressParam requestParam)` Get collection loading progress
`R<io.milvus.grpc.GetLoadStateResponse>` `getLoadState​(GetLoadStateParam requestParam)` Get collection loading state
`R<io.milvus.grpc.GetMetricsResponse>` `getMetrics​(GetMetricsParam requestParam)` Gets the runtime metrics information of Milvus, returns the result in .json format.
`R<io.milvus.grpc.GetPartitionStatisticsResponse>` `getPartitionStatistics​(GetPartitionStatisticsParam requestParam)` Shows the statistics information of a partition.
`R<io.milvus.grpc.GetPersistentSegmentInfoResponse>` `getPersistentSegmentInfo​(GetPersistentSegmentInfoParam requestParam)` Gets the information of persistent segments from data node, including row count, persistence state(growing or flushed), etc.
`R<io.milvus.grpc.GetQuerySegmentInfoResponse>` `getQuerySegmentInfo​(GetQuerySegmentInfoParam requestParam)` Gets the query information of segments in a collection from query node, including row count, memory usage size, index name, etc.
`R<io.milvus.grpc.GetReplicasResponse>` `getReplicas​(GetReplicasParam requestParam)` Returns the collection's replica information
`R<io.milvus.grpc.GetVersionResponse>` `getVersion()` Get server version
`R<RpcStatus>` `grantRolePrivilege​(GrantRolePrivilegeParam requestParam)` Grant Role Privilege.
`R<java.lang.Boolean>` `hasCollection​(HasCollectionParam requestParam)` Checks if a collection exists.
`R<java.lang.Boolean>` `hasPartition​(HasPartitionParam requestParam)` Checks if a partition exists in the specified collection.
`R<io.milvus.grpc.SearchResults>` `hybridSearch​(HybridSearchParam requestParam)` Conducts multi vector similarity search with a ranker for rearrangement.
`com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.SearchResults>>` `hybridSearchAsync​(HybridSearchParam requestParam)` Conducts multi vector similarity search asynchronously with a ranker for rearrangement.
`R<io.milvus.grpc.MutationResult>` `insert​(InsertParam requestParam)` Inserts entities into a specified collection .
`R<InsertResponse>` `insert​(InsertRowsParam requestParam)` Inserts rows data into a specified collection .
`com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.MutationResult>>` `insertAsync​(InsertParam requestParam)` Inserts entities into a specified collection asynchronously.
`R<io.milvus.grpc.ListAliasesResponse>` `listAliases​(ListAliasesParam requestParam)` List all alias for a collection.
`R<io.milvus.grpc.ListImportTasksResponse>` `listBulkInsertTasks​(ListBulkInsertTasksParam requestParam)` List bulk insert tasks
`R<ListCollectionsResponse>` `listCollections​(ListCollectionsParam requestParam)` Lists all collections
`R<io.milvus.grpc.ListCredUsersResponse>` `listCredUsers​(ListCredUsersParam requestParam)` List all user names.
`R<io.milvus.grpc.ListDatabasesResponse>` `listDatabases()` List databases.
`R<io.milvus.grpc.ListResourceGroupsResponse>` `listResourceGroups​(ListResourceGroupsParam requestParam)` List resource groups.
`R<RpcStatus>` `loadBalance​(LoadBalanceParam requestParam)` Moves segment from a query node to another to keep the load balanced.
`R<RpcStatus>` `loadCollection​(LoadCollectionParam requestParam)` Loads a collection to memory before search or query.
`R<RpcStatus>` `loadPartitions​(LoadPartitionsParam requestParam)` Loads a partition into memory.
`R<io.milvus.grpc.ManualCompactionResponse>` `manualCompact​(ManualCompactParam requestParam)` Performs a manual compaction.
`R<io.milvus.grpc.QueryResults>` `query​(QueryParam requestParam)` Queries entity(s) based on scalar field(s) filtered by boolean expression.
`R<QueryResponse>` `query​(QuerySimpleParam requestParam)` Queries entity(s) based on scalar field(s) filtered by boolean expression.
`com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.QueryResults>>` `queryAsync​(QueryParam requestParam)` Queries entity(s) asynchronously based on scalar field(s) filtered by boolean expression.
`R<QueryIterator>` `queryIterator​(QueryIteratorParam requestParam)` Get queryIterator based on scalar field(s) filtered by boolean expression.
`R<RpcStatus>` `releaseCollection​(ReleaseCollectionParam requestParam)` Releases a collection from memory to reduce memory usage.
`R<RpcStatus>` `releasePartitions​(ReleasePartitionsParam requestParam)` Releases a partition from memory.
`R<RpcStatus>` `removeUserFromRole​(RemoveUserFromRoleParam requestParam)` The user will remove permissions that the role are allowed to perform operations.
`R<RpcStatus>` `renameCollection​(RenameCollectionParam requestParam)` rename a collection
`R<RpcStatus>` `revokeRolePrivilege​(RevokeRolePrivilegeParam requestParam)` Revoke Role Privilege.
`R<io.milvus.grpc.SearchResults>` `search​(SearchParam requestParam)` Conducts ANN search on a vector field.
`R<SearchResponse>` `search​(SearchSimpleParam requestParam)` Conducts ANN search on a vector field.
`com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.SearchResults>>` `searchAsync​(SearchParam requestParam)` Conducts ANN search on a vector field asynchronously.
`R<SearchIterator>` `searchIterator​(SearchIteratorParam requestParam)` Get searchIterator based on a vector field.
`R<io.milvus.grpc.SelectGrantResponse>` `selectGrantForRole​(SelectGrantForRoleParam requestParam)` List a grant info for the role and the specific object
`R<io.milvus.grpc.SelectGrantResponse>` `selectGrantForRoleAndObject​(SelectGrantForRoleAndObjectParam requestParam)` List a grant info for the role
`R<io.milvus.grpc.SelectRoleResponse>` `selectRole​(SelectRoleParam requestParam)` Get all users who are added to the role.
`R<io.milvus.grpc.SelectUserResponse>` `selectUser​(SelectUserParam requestParam)` Get all roles the user has.
`void` `setLogLevel​(LogLevel level)` Set log level in runtime.
`R<io.milvus.grpc.ShowCollectionsResponse>` `showCollections​(ShowCollectionsParam requestParam)` Lists all collections or gets collection loading status.
`R<io.milvus.grpc.ShowPartitionsResponse>` `showPartitions​(ShowPartitionsParam requestParam)` Shows all partitions in the specified collection.
`R<RpcStatus>` `transferNode​(TransferNodeParam requestParam)` Transfer a query node from source resource group to target resource_group.
`R<RpcStatus>` `transferReplica​(TransferReplicaParam requestParam)` Transfer a replica from source resource group to target resource_group.
`R<RpcStatus>` `updateCredential​(UpdateCredentialParam requestParam)` Update credential using the given user and password.
`R<RpcStatus>` `updateResourceGroups​(UpdateResourceGroupsParam requestParam)` Update resource groups.
`R<io.milvus.grpc.MutationResult>` `upsert​(UpsertParam requestParam)` Insert new entities into a specified collection, replace them if the entities already exist.
`com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.MutationResult>>` `upsertAsync​(UpsertParam requestParam)` Insert new entities into a specified collection asynchronously, replace them if the entities already exist.
`MilvusClient` `withRetry​(int retryTimes)` Deprecated.
`MilvusClient` `withRetry​(RetryParam retryParam)` Sets the parameters for retry.
`MilvusClient` `withRetryInterval​(long interval, java.util.concurrent.TimeUnit timeUnit)` Deprecated.
`MilvusClient` `withTimeout​(long timeout, java.util.concurrent.TimeUnit timeoutUnit)` Timeout setting for rpc call.

### Method Detail

#### withTimeout

    MilvusClient withTimeout​(long timeout,
                             java.util.concurrent.TimeUnit timeoutUnit)

Timeout setting for rpc call.

Parameters:
  `timeout` - set time waiting for a rpc call.
  `timeoutUnit` - time unit

#### withRetry

    MilvusClient withRetry​(RetryParam retryParam)

Sets the parameters for retry.

Parameters:
  `retryParam` - `RetryParam`

#### withRetry

    @Deprecated
    MilvusClient withRetry​(int retryTimes)

Deprecated.
Number of retry attempts.

Parameters:
  `retryTimes` - number of retry attempts.

#### withRetryInterval

    @Deprecated
    MilvusClient withRetryInterval​(long interval,
                                   java.util.concurrent.TimeUnit timeUnit)

Deprecated.
Time interval between retry attempts. Default value is 500ms.

Parameters:
  `interval` - time interval between retry attempts.
  `timeUnit` - time unit

#### setLogLevel

    void setLogLevel​(LogLevel level)

Set log level in runtime.

Parameters:
  `level` - `LogLevel`

#### close

    default void close()

Disconnects from a Milvus server with timeout of 1 minute

#### close

    void close​(long maxWaitSeconds)
        throws java.lang.InterruptedException

Disconnects from a Milvus server with configurable timeout.

Parameters:
  `maxWaitSeconds` - timeout unit: second
Throws:
  `java.lang.InterruptedException`

#### hasCollection

    R<java.lang.Boolean> hasCollection​(HasCollectionParam requestParam)

Checks if a collection exists.

Parameters:
  `requestParam` - `HasCollectionParam`
Returns:
  {status:result code, data: boolean, whether if has collection or not}

#### createDatabase

    R<RpcStatus> createDatabase​(CreateDatabaseParam requestParam)

Creates a database in Milvus.

Parameters:
  `requestParam` - `CreateDatabaseParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### dropDatabase

    R<RpcStatus> dropDatabase​(DropDatabaseParam requestParam)

Drops a database. Note that this method drops all data in the database.

Parameters:
  `requestParam` - `DropDatabaseParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### listDatabases

    R<io.milvus.grpc.ListDatabasesResponse> listDatabases()

List databases. Note that this method list all database in the cluster.

Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### createCollection

    R<RpcStatus> createCollection​(CreateCollectionParam requestParam)

Creates a collection in Milvus.

Parameters:
  `requestParam` - `CreateCollectionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### dropCollection

    R<RpcStatus> dropCollection​(DropCollectionParam requestParam)

Drops a collection. Note that this method drops all data in the collection.

Parameters:
  `requestParam` - `DropCollectionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### loadCollection

    R<RpcStatus> loadCollection​(LoadCollectionParam requestParam)

Loads a collection to memory before search or query.

Parameters:
  `requestParam` - `LoadCollectionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### releaseCollection

    R<RpcStatus> releaseCollection​(ReleaseCollectionParam requestParam)

Releases a collection from memory to reduce memory usage. Note that you cannot search while the corresponding collection is released from memory.

Parameters:
  `requestParam` - `ReleaseCollectionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### describeCollection

    R<io.milvus.grpc.DescribeCollectionResponse> describeCollection​(DescribeCollectionParam requestParam)

Shows the details of a collection, e.g. name, schema.

Parameters:
  `requestParam` - `DescribeCollectionParam`
Returns:
  {status:result code, data:DescribeCollectionResponse{schema,collectionID}}

#### getCollectionStatistics

    R<io.milvus.grpc.GetCollectionStatisticsResponse> getCollectionStatistics​(GetCollectionStatisticsParam requestParam)

Shows the statistics information of a collection.

Parameters:
  `requestParam` - `GetCollectionStatisticsParam`
Returns:
  {status:result code, data: GetCollectionStatisticsResponse{status,stats}}

#### renameCollection

    R<RpcStatus> renameCollection​(RenameCollectionParam requestParam)

rename a collection

Parameters:
  `requestParam` - `RenameCollectionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### showCollections

    R<io.milvus.grpc.ShowCollectionsResponse> showCollections​(ShowCollectionsParam requestParam)

Lists all collections or gets collection loading status.

Parameters:
  `requestParam` - `ShowCollectionsParam`
Returns:
  {status:result code, data: ShowCollectionsResponse{status,collection_names,collection_ids,created_timestamps,created_utc_timestamps}}

#### alterCollection

    R<RpcStatus> alterCollection​(AlterCollectionParam requestParam)

Alter collection with key-value properties.

Parameters:
  `requestParam` - `AlterCollectionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### flush

    R<io.milvus.grpc.FlushResponse> flush​(FlushParam requestParam)

Flushes inserted data in buffer into storage.

Parameters:
  `requestParam` - `FlushParam`
Returns:
  {status:result code,data: FlushResponse{flush segment ids}}

#### flushAll

    R<io.milvus.grpc.FlushAllResponse> flushAll​(boolean syncFlushAll,
                                                long syncFlushAllWaitingInterval,
                                                long syncFlushAllTimeout)

Flush all collections. All insertions, deletions, and upserts before `flushAll` will be synced.

Parameters:
  `syncFlushAll` - {flushAll synchronously or asynchronously}
  `syncFlushAllWaitingInterval` - {wait intervel when flushAll synchronously}
  `syncFlushAllTimeout` - {timeout when flushAll synchronously}
Returns:
  {status:result code,data: FlushAllResponse{flushAllTs}}

#### createPartition

    R<RpcStatus> createPartition​(CreatePartitionParam requestParam)

Creates a partition in the specified collection.

Parameters:
  `requestParam` - `CreatePartitionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### dropPartition

    R<RpcStatus> dropPartition​(DropPartitionParam requestParam)

Drops a partition. Note that this method drops all data in this partition and the _default partition cannot be dropped.

Parameters:
  `requestParam` - `DropPartitionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### hasPartition

    R<java.lang.Boolean> hasPartition​(HasPartitionParam requestParam)

Checks if a partition exists in the specified collection.

Parameters:
  `requestParam` - `HasPartitionParam`
Returns:
  {status:result code, data: boolean, whether if has collection or not}

#### loadPartitions

    R<RpcStatus> loadPartitions​(LoadPartitionsParam requestParam)

Loads a partition into memory.

Parameters:
  `requestParam` - `LoadPartitionsParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### releasePartitions

    R<RpcStatus> releasePartitions​(ReleasePartitionsParam requestParam)

Releases a partition from memory.

Parameters:
  `requestParam` - `ReleasePartitionsParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### getPartitionStatistics

    R<io.milvus.grpc.GetPartitionStatisticsResponse> getPartitionStatistics​(GetPartitionStatisticsParam requestParam)

Shows the statistics information of a partition.

Parameters:
  `requestParam` - `GetPartitionStatisticsParam`
Returns:
  {status:result code,data:GetPartitionStatisticsResponse{status,stats}}

#### showPartitions

    R<io.milvus.grpc.ShowPartitionsResponse> showPartitions​(ShowPartitionsParam requestParam)

Shows all partitions in the specified collection.

Parameters:
  `requestParam` - `ShowPartitionsParam`
Returns:
  {status:result code, data:ShowPartitionsResponse{partition_names,partitionIDs,created_timestamps,created_utc_timestamps}}

#### createAlias

    R<RpcStatus> createAlias​(CreateAliasParam requestParam)

Creates an alias for a collection. Alias can be used in search or query to replace the collection name

Parameters:
  `requestParam` - `CreateAliasParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### dropAlias

    R<RpcStatus> dropAlias​(DropAliasParam requestParam)

Drops an alias for the specified collection.

Parameters:
  `requestParam` - `DropAliasParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### alterAlias

    R<RpcStatus> alterAlias​(AlterAliasParam requestParam)

Alters alias from a collection to another.

Parameters:
  `requestParam` - `AlterAliasParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### listAliases

    R<io.milvus.grpc.ListAliasesResponse> listAliases​(ListAliasesParam requestParam)

List all alias for a collection.

Parameters:
  `requestParam` - `ListAliasesParam`
Returns:
  {status:result code, data:ListAliasesResponse{status, aliases}}

#### createIndex

    R<RpcStatus> createIndex​(CreateIndexParam requestParam)

Creates an index on a vector field in the specified collection. Note that index building is an async progress.

Parameters:
  `requestParam` - `CreateIndexParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### dropIndex

    R<RpcStatus> dropIndex​(DropIndexParam requestParam)

Drops the index on a vector field in the specified collection.

Parameters:
  `requestParam` - `DropIndexParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### describeIndex

    R<io.milvus.grpc.DescribeIndexResponse> describeIndex​(DescribeIndexParam requestParam)

Shows the information of the specified index. Current release of Milvus only supports showing latest built index.

Parameters:
  `requestParam` - `DescribeIndexParam`
Returns:
  {status:result code, data:DescribeIndexResponse{status,index_descriptions}}

#### getIndexState

    R<io.milvus.grpc.GetIndexStateResponse> getIndexState​(GetIndexStateParam requestParam)

Shows the index building state(in-progress/finished/failed), and the reason for failure (if any).

Parameters:
  `requestParam` - `GetIndexStateParam`
Returns:
  {status:result code, data:GetIndexStateResponse{status,state}}

#### getIndexBuildProgress

    R<io.milvus.grpc.GetIndexBuildProgressResponse> getIndexBuildProgress​(GetIndexBuildProgressParam requestParam)

Shows the index building progress, such as how many rows are indexed.

Parameters:
  `requestParam` - `GetIndexBuildProgressParam`
Returns:
  {status:result code, data:GetIndexBuildProgressResponse{status,indexed_rows}}

#### alterIndex

    R<RpcStatus> alterIndex​(AlterIndexParam requestParam)

Alter index with key value properties.

Parameters:
  `requestParam` - `AlterIndexParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### insert

    R<io.milvus.grpc.MutationResult> insert​(InsertParam requestParam)

Inserts entities into a specified collection . Note that you don't need to input primary key field if auto_id is enabled.

Parameters:
  `requestParam` - `InsertParam`
Returns:
  {status:result code, data: MutationResult{insert results}}

#### insertAsync

    com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.MutationResult>> insertAsync​(InsertParam requestParam)

Inserts entities into a specified collection asynchronously. Note that you don't need to input primary key field if auto_id is enabled.

Parameters:
  `requestParam` - `InsertParam`
Returns:
  a `ListenableFuture` object which holds the object {status:result code, data: MutationResult{insert results}}

#### upsert

    R<io.milvus.grpc.MutationResult> upsert​(UpsertParam requestParam)

Insert new entities into a specified collection, replace them if the entities already exist.

Parameters:
  `requestParam` - `UpsertParam`
Returns:
  {status:result code, data: MutationResult{insert results}}

#### upsertAsync

    com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.MutationResult>> upsertAsync​(UpsertParam requestParam)

Insert new entities into a specified collection asynchronously, replace them if the entities already exist.

Parameters:
  `requestParam` - `UpsertParam`
Returns:
  a `ListenableFuture` object which holds the object {status:result code, data: MutationResult{insert results}}

#### delete

    R<io.milvus.grpc.MutationResult> delete​(DeleteParam requestParam)

Deletes entity(s) based on primary key(s) filtered by boolean expression. Current release of Milvus only supports expression in the format "pk_field in [1, 2, ...]"

Parameters:
  `requestParam` - `DeleteParam`
Returns:
  {status:result code, data: MutationResult{delete results}}

#### search

    R<io.milvus.grpc.SearchResults> search​(SearchParam requestParam)

Conducts ANN search on a vector field. Use expression to do filtering before search.

Parameters:
  `requestParam` - `SearchParam`
Returns:
  {status:result code, data: SearchResults{topK results}}

#### searchAsync

    com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.SearchResults>> searchAsync​(SearchParam requestParam)

Conducts ANN search on a vector field asynchronously. Use expression to do filtering before search.

Parameters:
  `requestParam` - `SearchParam`
Returns:
  a `ListenableFuture` object which holds the object {status:result code, data: SearchResults{topK results}}

#### hybridSearch

    R<io.milvus.grpc.SearchResults> hybridSearch​(HybridSearchParam requestParam)

Conducts multi vector similarity search with a ranker for rearrangement.

Parameters:
  `requestParam` - `HybridSearchParam`
Returns:
  {status:result code, data: SearchResults{topK results}}

#### hybridSearchAsync

    com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.SearchResults>> hybridSearchAsync​(HybridSearchParam requestParam)

Conducts multi vector similarity search asynchronously with a ranker for rearrangement.

Parameters:
  `requestParam` - `HybridSearchParam`
Returns:
  a `ListenableFuture` object which holds the object {status:result code, data: SearchResults{topK results}}

#### query

    R<io.milvus.grpc.QueryResults> query​(QueryParam requestParam)

Queries entity(s) based on scalar field(s) filtered by boolean expression. Note that the order of the returned entities cannot be guaranteed.

Parameters:
  `requestParam` - `QueryParam`
Returns:
  {status:result code,data: QueryResults{filter results}}

#### queryAsync

    com.google.common.util.concurrent.ListenableFuture<R<io.milvus.grpc.QueryResults>> queryAsync​(QueryParam requestParam)

Queries entity(s) asynchronously based on scalar field(s) filtered by boolean expression. Note that the order of the returned entities cannot be guaranteed.

Parameters:
  `requestParam` - `QueryParam`
Returns:
  {status:result code,data: QueryResults{filter results}}

#### getMetrics

    R<io.milvus.grpc.GetMetricsResponse> getMetrics​(GetMetricsParam requestParam)

Gets the runtime metrics information of Milvus, returns the result in .json format.

Parameters:
  `requestParam` - `GetMetricsParam`
Returns:
  {status:result code, data:GetMetricsResponse{status,metrics}}

#### getFlushState

    R<io.milvus.grpc.GetFlushStateResponse> getFlushState​(GetFlushStateParam requestParam)

Get flush state of specified collection.

Parameters:
  `requestParam` - `GetFlushStateParam`
Returns:
  {status:result code, data:GetMetricsResponse{status,metrics}}

#### getFlushAllState

    R<io.milvus.grpc.GetFlushAllStateResponse> getFlushAllState​(GetFlushAllStateParam requestParam)

Get flush state of all segments.

Parameters:
  `requestParam` - `GetFlushAllStateParam`
Returns:
  {status:result code, data:GetMetricsResponse{status,metrics}}

#### getPersistentSegmentInfo

    R<io.milvus.grpc.GetPersistentSegmentInfoResponse> getPersistentSegmentInfo​(GetPersistentSegmentInfoParam requestParam)

Gets the information of persistent segments from data node, including row count, persistence state(growing or flushed), etc.

Parameters:
  `requestParam` - `GetPersistentSegmentInfoParam`
Returns:
  {status:result code, data:GetPersistentSegmentInfoResponse{status,info}}

#### getQuerySegmentInfo

    R<io.milvus.grpc.GetQuerySegmentInfoResponse> getQuerySegmentInfo​(GetQuerySegmentInfoParam requestParam)

Gets the query information of segments in a collection from query node, including row count, memory usage size, index name, etc.

Parameters:
  `requestParam` - `GetQuerySegmentInfoParam`
Returns:
  {status:result code, data:GetQuerySegmentInfoResponse{status,info}}

#### getReplicas

    R<io.milvus.grpc.GetReplicasResponse> getReplicas​(GetReplicasParam requestParam)

Returns the collection's replica information

Parameters:
  `requestParam` - `GetReplicasParam`
Returns:
  {status:result code, data:GetReplicasResponse{status,info}}

#### loadBalance

    R<RpcStatus> loadBalance​(LoadBalanceParam requestParam)

Moves segment from a query node to another to keep the load balanced.

Parameters:
  `requestParam` - `LoadBalanceParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### getCompactionState

    R<io.milvus.grpc.GetCompactionStateResponse> getCompactionState​(GetCompactionStateParam requestParam)

Gets the compaction state by id.

Parameters:
  `requestParam` - `GetCompactionStateParam`
Returns:
  {status:result code, data:GetCompactionStateResponse{status,info}}

#### manualCompact

    R<io.milvus.grpc.ManualCompactionResponse> manualCompact​(ManualCompactParam requestParam)

Performs a manual compaction.

Parameters:
  `requestParam` - `ManualCompactParam`
Returns:
  {status:result code, data:ManualCompactionResponse{status,info}}

#### getCompactionStateWithPlans

    R<io.milvus.grpc.GetCompactionPlansResponse> getCompactionStateWithPlans​(GetCompactionPlansParam requestParam)

Gets compaction state with its plan.

Parameters:
  `requestParam` - `GetCompactionPlansParam`
Returns:
  {status:result code, data:GetCompactionPlansResponse{status,info}}

#### createCredential

    R<RpcStatus> createCredential​(CreateCredentialParam requestParam)

Create credential using the given user and password.

Parameters:
  `requestParam` - `CreateCredentialParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### updateCredential

    R<RpcStatus> updateCredential​(UpdateCredentialParam requestParam)

Update credential using the given user and password. You must provide the original password to check if the operation is valid. Note: after this operation, client won't change the related header of this connection. So if you update credential for this connection, the connection may be invalid.

Parameters:
  `requestParam` - `UpdateCredentialParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### deleteCredential

    R<RpcStatus> deleteCredential​(DeleteCredentialParam requestParam)

Delete credential corresponding to the user.

Parameters:
  `requestParam` - `DeleteCredentialParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### listCredUsers

    R<io.milvus.grpc.ListCredUsersResponse> listCredUsers​(ListCredUsersParam requestParam)

List all user names.

Parameters:
  `requestParam` - `ListCredUsersParam`
Returns:
  {status:result code, data:ListCredUsersResponse{status,info}}

#### createRole

    R<RpcStatus> createRole​(CreateRoleParam requestParam)

It will success if the role isn't existed, otherwise fail.

Parameters:
  `requestParam` - `CreateRoleParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### dropRole

    R<RpcStatus> dropRole​(DropRoleParam requestParam)

It will success if the role is existed, otherwise fail.

Parameters:
  `requestParam` - `DropRoleParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### addUserToRole

    R<RpcStatus> addUserToRole​(AddUserToRoleParam requestParam)

The user will get permissions that the role are allowed to perform operations.

Parameters:
  `requestParam` - `AddUserToRoleParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### removeUserFromRole

    R<RpcStatus> removeUserFromRole​(RemoveUserFromRoleParam requestParam)

The user will remove permissions that the role are allowed to perform operations.

Parameters:
  `requestParam` - `AddUserToRoleParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### selectRole

    R<io.milvus.grpc.SelectRoleResponse> selectRole​(SelectRoleParam requestParam)

Get all users who are added to the role.

Parameters:
  `requestParam` - `SelectRoleParam`
Returns:
  {status:result code, data:SelectRoleResponse{status,info}}

#### selectUser

    R<io.milvus.grpc.SelectUserResponse> selectUser​(SelectUserParam requestParam)

Get all roles the user has.

Parameters:
  `requestParam` - `SelectUserParam`
Returns:
  {status:result code, data:SelectUserResponse{status,info}}

#### grantRolePrivilege

    R<RpcStatus> grantRolePrivilege​(GrantRolePrivilegeParam requestParam)

Grant Role Privilege.

Parameters:
  `requestParam` - `GrantRolePrivilegeParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### revokeRolePrivilege

    R<RpcStatus> revokeRolePrivilege​(RevokeRolePrivilegeParam requestParam)

Revoke Role Privilege.

Parameters:
  `requestParam` - `RevokeRolePrivilegeParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### selectGrantForRole

    R<io.milvus.grpc.SelectGrantResponse> selectGrantForRole​(SelectGrantForRoleParam requestParam)

List a grant info for the role and the specific object

Parameters:
  `requestParam` - `SelectGrantForRoleParam`
Returns:
  {status:result code, data:SelectRoleResponse{status,info}}

#### selectGrantForRoleAndObject

    R<io.milvus.grpc.SelectGrantResponse> selectGrantForRoleAndObject​(SelectGrantForRoleAndObjectParam requestParam)

List a grant info for the role

Parameters:
  `requestParam` - `SelectGrantForRoleAndObjectParam`
Returns:
  {status:result code, data:SelectRoleResponse{status,info}}

#### bulkInsert

    R<io.milvus.grpc.ImportResponse> bulkInsert​(BulkInsertParam requestParam)

Import data from external files, currently support JSON format

Parameters:
  `requestParam` - `BulkInsertParam`
Returns:
  {status:result code, data:ImportResponse{status,info}}

#### getBulkInsertState

    R<io.milvus.grpc.GetImportStateResponse> getBulkInsertState​(GetBulkInsertStateParam requestParam)

Get state of bulk insert task

Parameters:
  `requestParam` - `GetBulkInsertStateParam`
Returns:
  {status:result code, data:GetImportStateResponse{status,info}}

#### listBulkInsertTasks

    R<io.milvus.grpc.ListImportTasksResponse> listBulkInsertTasks​(ListBulkInsertTasksParam requestParam)

List bulk insert tasks

Parameters:
  `requestParam` - `ListBulkInsertTasksParam`
Returns:
  {status:result code, data:ListImportTasksResponse{status,info}}

#### checkHealth

    R<io.milvus.grpc.CheckHealthResponse> checkHealth()

Check server health

Returns:
  {status:result code, data:CheckHealthResponse{status,info}}

#### getVersion

    R<io.milvus.grpc.GetVersionResponse> getVersion()

Get server version

Returns:
  {status:result code, data:GetVersionResponse{status,info}}

#### getLoadingProgress

    R<io.milvus.grpc.GetLoadingProgressResponse> getLoadingProgress​(GetLoadingProgressParam requestParam)

Get collection loading progress

Parameters:
  `requestParam` - `GetLoadingProgressParam`
Returns:
  {status:result code, data:GetLoadingProgressResponse{status}}

#### getLoadState

    R<io.milvus.grpc.GetLoadStateResponse> getLoadState​(GetLoadStateParam requestParam)

Get collection loading state

Parameters:
  `requestParam` - `GetLoadStateParam`
Returns:
  {status:result code, data:GetLoadStateResponse{status}}

#### createResourceGroup

    R<RpcStatus> createResourceGroup​(CreateResourceGroupParam requestParam)

Create a resource group.

Parameters:
  `requestParam` - `CreateResourceGroupParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### updateResourceGroups

    R<RpcStatus> updateResourceGroups​(UpdateResourceGroupsParam requestParam)

Update resource groups.

Parameters:
  `requestParam` - `UpdateResourceGroupsParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### dropResourceGroup

    R<RpcStatus> dropResourceGroup​(DropResourceGroupParam requestParam)

Drop a resource group.

Parameters:
  `requestParam` - `DropResourceGroupParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### listResourceGroups

    R<io.milvus.grpc.ListResourceGroupsResponse> listResourceGroups​(ListResourceGroupsParam requestParam)

List resource groups.

Parameters:
  `requestParam` - `ListResourceGroupsParam`
Returns:
  {status:result code, data:ListResourceGroupsResponse{status}}

#### describeResourceGroup

    R<io.milvus.grpc.DescribeResourceGroupResponse> describeResourceGroup​(DescribeResourceGroupParam requestParam)

Describe a resource group.

Parameters:
  `requestParam` - `DescribeResourceGroupParam`
Returns:
  {status:result code, data:DescribeResourceGroupResponse{status}}

#### transferNode

    R<RpcStatus> transferNode​(TransferNodeParam requestParam)

Transfer a query node from source resource group to target resource_group.

Parameters:
  `requestParam` - `TransferNodeParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### transferReplica

    R<RpcStatus> transferReplica​(TransferReplicaParam requestParam)

Transfer a replica from source resource group to target resource_group.

Parameters:
  `requestParam` - `TransferReplicaParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### createCollection

    R<RpcStatus> createCollection​(CreateSimpleCollectionParam requestParam)

Creates a collection in Milvus.

Parameters:
  `requestParam` - `CreateSimpleCollectionParam`
Returns:
  {status:result code, data:RpcStatus{msg: result message}}

#### listCollections

    R<ListCollectionsResponse> listCollections​(ListCollectionsParam requestParam)

Lists all collections

Parameters:
  `requestParam` - `ListCollectionsParam`
Returns:
  {status:result code, data: ListCollectionsResponse{collection_names}}

#### insert

    R<InsertResponse> insert​(InsertRowsParam requestParam)

Inserts rows data into a specified collection . Note that you don't need to input primary key field if auto_id is enabled.

Parameters:
  `requestParam` - `InsertRowsParam`
Returns:
  {status:result code, data: MutationResult{insert results}}

#### delete

    R<DeleteResponse> delete​(DeleteIdsParam requestParam)

Deletes entity(s) based on the value of primary key.

Parameters:
  `requestParam` - `DeleteIdsParam`
Returns:
  {status:result code, data: MutationResult{delete results}}

#### get

    R<GetResponse> get​(GetIdsParam requestParam)

Get entity(s) based on the value of primary key.

Parameters:
  `requestParam` - `GetIdsParam`
Returns:
  {status:result code, data: QueryResults{query results}}

#### query

    R<QueryResponse> query​(QuerySimpleParam requestParam)

Queries entity(s) based on scalar field(s) filtered by boolean expression. Note that the order of the returned entities cannot be guaranteed.

Parameters:
  `requestParam` - `QuerySimpleParam`
Returns:
  {status:result code,data: QueryResults{filter results}}

#### search

    R<SearchResponse> search​(SearchSimpleParam requestParam)

Conducts ANN search on a vector field. Use expression to do filtering before search.

Parameters:
  `requestParam` - `SearchSimpleParam`
Returns:
  {status:result code, data: SearchResults{topK results}}

#### queryIterator

    R<QueryIterator> queryIterator​(QueryIteratorParam requestParam)

Get queryIterator based on scalar field(s) filtered by boolean expression. Note that the order of the returned entities cannot be guaranteed.

Parameters:
  `requestParam` - `QueryIteratorParam`
Returns:
  {status:result code,data: QueryIterator}

#### searchIterator

    R<SearchIterator> searchIterator​(SearchIteratorParam requestParam)

Get searchIterator based on a vector field. Use expression to do filtering before search.

Parameters:
  `requestParam` - `SearchIteratorParam`
Returns:
  {status:result code, data: SearchIterator}