milvus-logo
Star
0
Forks
0
快速开始

Interface MilvusClient

    • 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
      • 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}
      • 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}}
      • 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}}
      • 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}}
      • 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}}
      • 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}}
      • 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}}
      • 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}}
      • calcDistance

        R<io.milvus.grpc.CalcDistanceResults> calcDistance​(CalcDistanceParam requestParam)
        Calculates the distance between the specified vectors.
        Parameters:
        requestParam - CalcDistanceParam
        Returns:
        {status:result code, data: CalcDistanceResults{distances}}
      • 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 segments.
        Parameters:
        requestParam - GetFlushStateParam
        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}}
      • 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}}
      • manualCompaction

        R<io.milvus.grpc.ManualCompactionResponse> manualCompaction​(ManualCompactionParam requestParam)
        Performs a manual compaction.
        Parameters:
        requestParam - ManualCompactionParam
        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}}