### Install Qdrant Go Client Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2 Use 'go get' to install the Qdrant Go client library. ```go go get -u github.com/qdrant/go-client ``` -------------------------------- ### Update Collection Cluster Setup Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Placeholder for Update Collection Cluster Setup RPC. Implement this method to modify collection cluster setup. ```go func (UnimplementedCollectionsServer) UpdateCollectionClusterSetup(context.Context, *UpdateCollectionClusterSetupRequest) (*UpdateCollectionClusterSetupResponse, error) ``` -------------------------------- ### NewDefaultGrpcClient Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a new gRPC client with default configuration. This is a convenient way to get started without specifying custom settings. ```APIDOC ## NewDefaultGrpcClient ### Description Creates a new gRPC client with default configuration. ### Method func NewDefaultGrpcClient() (*GrpcClient, error) ### Returns - *GrpcClient: A pointer to the initialized GrpcClient. - error: An error if the client creation fails. ``` -------------------------------- ### Get Collection Info Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Placeholder for Get Collection Info RPC. Implement this method to retrieve collection information. ```go func (UnimplementedCollectionsServer) Get(context.Context, *GetCollectionInfoRequest) (*GetCollectionInfoResponse, error) ``` -------------------------------- ### Recommend Points Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Looks for points that are closer to stored positive examples and further from negative examples. ```APIDOC ## POST /points/{collection_name}/recommend ### Description Looks for points that are closer to stored positive examples and further from negative examples. ### Method POST ### Endpoint /points/{collection_name}/recommend ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection to recommend points from. #### Request Body - **positive** (array) - Optional - An array of points that are considered positive examples. - **id** (integer | string) - Required - The ID of the positive example point. - **negative** (array) - Optional - An array of points that are considered negative examples. - **id** (integer | string) - Required - The ID of the negative example point. - **vector** (array) - Optional - The query vector to compare against. If not provided, recommendations are based solely on positive and negative examples. - **filter** (object) - Optional - A filter to apply to the recommendation. - **limit** (integer) - Required - The maximum number of results to return. - **with_payload** (boolean) - Optional - Whether to include the payload in the response. - **with_vectors** (boolean) - Optional - Whether to include the vectors in the response. ### Request Example ```json { "positive": [{"id": "point1"}], "negative": [{"id": "point2"}], "limit": 10, "with_payload": true } ``` ### Response #### Success Response (200) - **points** (array) - An array of recommended points. - **id** (integer | string) - The unique identifier for the point. - **score** (number) - The recommendation score of the point. - **payload** (object) - The payload associated with the point. - **vector** (object | array) - The vector(s) associated with the point. #### Response Example ```json { "points": [ { "id": 3, "score": 0.98, "payload": {"key": "value"} } ] } ``` ``` -------------------------------- ### ContextExamplePair.GetPositive Method Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Retrieves the positive example vector from a ContextExamplePair. Added in v1.7.0. ```go func (x *ContextExamplePair) GetPositive() *VectorExample ``` -------------------------------- ### Get Query Sample Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the Sample configuration for sampling points from a Query. ```go func (x *Query) GetSample() Sample ``` -------------------------------- ### VectorExample struct definition Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Defines a structure for examples related to vectors, allowing different types of examples via a protobuf oneof. Added in v1.7.0. ```go type VectorExample struct { // Types that are assignable to Example: // // *VectorExample_Id // *VectorExample_Vector Example isVectorExample_Example `protobuf_oneof:"example"` // contains filtered or unexported fields } ``` -------------------------------- ### Get Quantization Configuration Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the quantization configuration for the collection. ```go func (x *UpdateCollection) GetQuantizationConfig() *QuantizationConfigDiff ``` -------------------------------- ### StartFrom String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns a string representation of the StartFrom instance. ```go func (x *StartFrom) String() string ``` -------------------------------- ### Create Basic Qdrant Client Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2 Instantiate a Qdrant client to connect to a local Qdrant instance on the default port. ```go import "github.com/qdrant/go-client/qdrant" client, err := qdrant.NewClient(&qdrant.Config{ Host: "localhost", Port: 6334, }) ``` -------------------------------- ### StartFrom Descriptor Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Deprecated method to get the descriptor for StartFrom. Use ProtoReflect.Descriptor instead. ```go func (*StartFrom) Descriptor() ([]byte, []int) ``` -------------------------------- ### StartFrom ProtoReflect Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Provides reflection capabilities for the StartFrom message. ```go func (x *StartFrom) ProtoReflect() protoreflect.Message ``` -------------------------------- ### Get WriteOrderingType Enum Descriptor (Deprecated) Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Deprecated method to get the enum descriptor for WriteOrderingType. Use WriteOrderingType.Descriptor instead. ```go func (WriteOrderingType) EnumDescriptor() ([]byte, []int) ``` -------------------------------- ### NewStartFromInt Constructor Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a StartFrom instance for an integer value. ```go func NewStartFromInt(value int64) *StartFrom ``` -------------------------------- ### NewStartFromDatetime Constructor Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a StartFrom instance for a datetime string in RFC3339 format. ```go func NewStartFromDatetime(value string) *StartFrom ``` -------------------------------- ### Update Cluster Collection Setup Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Updates the cluster setup configuration for a specific collection. Use this to modify cluster-wide settings for a collection. ```go func (c *Client) UpdateClusterCollectionSetup(ctx context.Context, request *UpdateCollectionClusterSetupRequest) error ``` -------------------------------- ### BinaryQuantizationQueryEncoding GetSetting Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the setting for BinaryQuantizationQueryEncoding. ```go func (x *BinaryQuantizationQueryEncoding) GetSetting() BinaryQuantizationQueryEncoding_Setting ``` -------------------------------- ### ContextExamplePair.String Method Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Returns a string representation of the ContextExamplePair. Added in v1.7.0. ```go func (x *ContextExamplePair) String() string ``` -------------------------------- ### Client Initialization Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Provides methods for initializing a Qdrant client, either with default settings or custom configuration. ```APIDOC ## Client Initialization ### Description Methods to create a new Qdrant client instance. ### Methods - `DefaultClient()`: Creates a client with default configuration. - `NewClient(config *Config)`: Creates a client with a specified configuration. ### Returns - `(*Client, error)`: A pointer to the initialized Client and an error if initialization fails. ``` -------------------------------- ### Go: AliasDescription Functions Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Provides function signatures for AliasDescription, including methods for descriptor, getting alias name, and getting collection name. These are used to access alias details. ```go func (*AliasDescription) Descriptor() ([]byte, []int) Deprecated: Use AliasDescription.ProtoReflect.Descriptor instead. ``` ```go func (x *AliasDescription) GetAliasName() string ``` ```go func (x *AliasDescription) GetCollectionName() string ``` ```go func (*AliasDescription) ProtoMessage() ``` ```go func (x *AliasDescription) ProtoReflect() protoreflect.Message ``` ```go func (x *AliasDescription) Reset() ``` ```go func (x *AliasDescription) String() string ``` -------------------------------- ### OrderBy GetStartFrom Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the start from value for OrderBy. Added in v1.8.0. ```go func (x *OrderBy) GetStartFrom() *StartFrom ``` -------------------------------- ### NewStartFromTimestamp Constructor Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a StartFrom instance for a timestamp value. Parameters include seconds and nanoseconds, with specific range constraints. ```go func NewStartFromTimestamp(seconds int64, nanos int32) *StartFrom ``` -------------------------------- ### CollectionsClient.UpdateCollectionClusterSetup Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Updates the cluster setup for a collection. ```APIDOC ## Update Collection Cluster Setup ### Description Updates the cluster setup for a collection. ### Method PUT ### Endpoint /collections/{collection_name}/cluster_setup ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection to update cluster setup for. #### Query Parameters None #### Request Body - **replication_factor** (integer) - Optional - The new replication factor for the collection. - **write_consistency_factor** (integer) - Optional - The new write consistency factor for the collection. - **read_fan_out** (integer) - Optional - The new read fan-out for the collection. ### Request Example ```json { "replication_factor": 3, "write_consistency_factor": 2 } ``` ### Response #### Success Response (200) - **status** (string) - The status of the operation. #### Response Example ```json { "status": "ok" } ``` ``` -------------------------------- ### UpdateClusterCollectionSetup Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Updates the cluster setup configuration for a collection. ```APIDOC ## UpdateClusterCollectionSetup ### Description Updates the cluster setup configuration for a collection. ### Method PUT (assumed, based on common SDK patterns for configuration updates) ### Endpoint /collections/{collection_name}/cluster/setup ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection. #### Request Body - **request** (*UpdateCollectionClusterSetupRequest) - Required - The cluster setup update request. ``` -------------------------------- ### NewStartFromFloat Constructor Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a StartFrom instance for a float value. ```go func NewStartFromFloat(value float64) *StartFrom ``` -------------------------------- ### UpdateCollectionClusterSetup Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Updates the cluster setup configuration for a collection. ```APIDOC ## UpdateCollectionClusterSetup ### Description Updates the cluster setup configuration for a collection. ### Method *Not specified, likely a gRPC or SDK method* ### Endpoint *Not specified, likely a gRPC or SDK method* ### Parameters #### Path Parameters *None specified* #### Query Parameters *None specified* #### Request Body - **context** (context.Context) - Required - Context for the request. - **request** (*UpdateCollectionClusterSetupRequest) - Required - Request object containing the cluster setup update details. ### Request Example *Not specified* ### Response #### Success Response - **response** (*UpdateCollectionClusterSetupResponse) - The response indicating the result of the cluster setup update. - **error** (error) - An error if the operation failed. #### Response Example *Not specified* ``` -------------------------------- ### StartFrom Reset Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Resets the StartFrom instance to its zero value. ```go func (x *StartFrom) Reset() ``` -------------------------------- ### Create Default GrpcClient Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a new gRPC client with default configuration. Use this for quick setup. ```go func NewDefaultGrpcClient() (*GrpcClient, error) ``` -------------------------------- ### Get Collection Parameters Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the parameters for the collection. ```go func (x *UpdateCollection) GetParams() *CollectionParamsDiff ``` -------------------------------- ### Get Query Recommend Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the RecommendInput for a recommendation query from a Query. ```go func (x *Query) GetRecommend() *RecommendInput ``` -------------------------------- ### Get Points Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves points from a collection by their IDs. ```APIDOC ## GET /points/{collection_name} ### Description Retrieves points from a collection by their IDs. ### Method GET ### Endpoint /points/{collection_name} ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection to retrieve points from. #### Query Parameters - **ids** (array) - Required - An array of point IDs to retrieve. - **with_payload** (boolean) - Optional - Whether to include the payload in the response. - **with_vectors** (boolean) - Optional - Whether to include the vectors in the response. ### Response #### Success Response (200) - **points** (array) - An array of retrieved points. - **id** (integer | string) - The unique identifier for the point. - **vector** (object | array) - The vector(s) associated with the point. - **payload** (object) - The payload associated with the point. #### Response Example ```json { "points": [ { "id": 1, "vector": [0.1, 0.2, 0.3], "payload": {"key": "value"} } ] } ``` ``` -------------------------------- ### Create Default Qdrant Client Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Instantiates a new Qdrant client using the default configuration, connecting to localhost:6334 with TLS disabled. Use this for quick local testing. ```go func DefaultClient() (*Client, error) ``` -------------------------------- ### Get Timeout from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the timeout value from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetTimeout() uint64 ``` -------------------------------- ### StartFrom Constructors Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Provides functions to create StartFrom objects for different value types: datetime, float, integer, and timestamp. ```APIDOC ## StartFrom Constructors ### Description Functions to create `StartFrom` objects for various data types. ### Functions #### `NewStartFromDatetime(value string) *StartFrom` Creates a `*StartFrom` instance for a datetime string in RFC3339 format. #### `NewStartFromFloat(value float64) *StartFrom` Creates a `*StartFrom` instance for a float value. #### `NewStartFromInt(value int64) *StartFrom` Creates a `*StartFrom` instance for an integer value. #### `NewStartFromTimestamp(seconds int64, nanos int32) *StartFrom` Creates a `*StartFrom` instance for a timestamp value. - **seconds**: Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - **nanos**: Non-negative fractions of a second at nanosecond resolution. Must be from 0 to 999,999,999 inclusive. ``` -------------------------------- ### Get RestartTransfer from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the RestartTransfer object from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetRestartTransfer() *RestartTransfer ``` -------------------------------- ### Create Sample Query Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a Query instance for sampling points from the collection. ```go func NewQuerySample(sample Sample) *Query ``` -------------------------------- ### StartFrom GetInteger Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the integer value from a StartFrom instance. ```go func (*StartFrom) GetInteger() int64 ``` -------------------------------- ### Get ReplicateShard from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the ReplicateShard object from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetReplicateShard() *ReplicateShard ``` -------------------------------- ### StartFrom ProtoMessage Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Interface method for protobuf message compatibility. ```go func (*StartFrom) ProtoMessage() ``` -------------------------------- ### Get ReplicatePoints from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the ReplicatePoints object from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetReplicatePoints() *ReplicatePoints ``` -------------------------------- ### Recommend Batch Points Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Performs batch recommendations based on positive and negative example pairs. ```APIDOC ## Recommend Batch Points ### Description Performs batch recommendations based on positive and negative example pairs. ### Method POST ### Endpoint /points/{collection_name}/recommend/batch ### Parameters #### Path Parameters - **collection_name** (string) - Required - The name of the collection to recommend points from. #### Request Body - **recommendations** (array) - Required - An array of recommendation requests. - **positive** (array) - Optional - A list of point IDs that are positive examples. - **negative** (array) - Optional - A list of point IDs that are negative examples. - **filter** (object) - Optional - A filter to apply to the recommendation. - **limit** (integer) - Required - The maximum number of results to return. ### Request Example ```json { "recommendations": [ { "positive": [1, 2], "limit": 5 }, { "negative": [3, 4], "limit": 5 } ] } ``` ### Response #### Success Response (200) - **results** (array) - An array of recommendation results, corresponding to the input recommendations. - **points** (array) - An array of recommended points for a single request. - **id** (integer or string) - The unique identifier for the point. - **score** (number) - The recommendation score. - **vector** (object or array) - The vector associated with the point. - **payload** (object) - The payload associated with the point. #### Response Example ```json { "results": [ { "points": [ { "id": 5, "score": 0.98, "vector": [0.7, 0.8, 0.9], "payload": {"key": "value"} } ] } ] } ``` ``` -------------------------------- ### GrpcClient Initialization Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Provides methods to create and manage a gRPC client for interacting with the Qdrant API. This includes creating clients with default or custom configurations, and from an existing gRPC connection. ```APIDOC ## GrpcClient Lower level client for Qdrant gRPC API. ### Methods #### NewDefaultGrpcClient ```go func NewDefaultGrpcClient() (*GrpcClient, error) ``` Create a new gRPC client with default configuration. #### NewGrpcClient ```go func NewGrpcClient(config *Config) (*GrpcClient, error) ``` Create a new gRPC client with custom configuration. #### NewGrpcClientFromConn ```go func NewGrpcClientFromConn(conn *grpc.ClientConn) *GrpcClient ``` Create a new gRPC client from existing connection. #### Close ```go func (c *GrpcClient) Close() error ``` Tears down the *grpc.ClientConn and all underlying connections. #### Conn ```go func (c *GrpcClient) Conn() *grpc.ClientConn ``` Get the underlying gRPC connection. ``` -------------------------------- ### Get Operation from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the operation type from the UpdateCollectionClusterSetupRequest. ```go func (m *UpdateCollectionClusterSetupRequest) GetOperation() isUpdateCollectionClusterSetupRequest_Operation ``` -------------------------------- ### Get MoveShard from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the MoveShard object from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetMoveShard() *MoveShard ``` -------------------------------- ### ContextExamplePair.ProtoMessage Method Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Returns a marker indicating that ContextExamplePair implements the proto.Message interface. Added in v1.7.0. ```go func (*ContextExamplePair) ProtoMessage() ``` -------------------------------- ### Get DeleteShardKey from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the DeleteShardKey object from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetDeleteShardKey() *DeleteShardKey ``` -------------------------------- ### Get CreateShardKey from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the CreateShardKey object from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetCreateShardKey() *CreateShardKey ``` -------------------------------- ### Create Qdrant Client with Configuration Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a new Qdrant client with a custom configuration. It supports connection pooling by setting Config.PoolSize, distributing requests across multiple connections. ```go func NewClient(config *Config) (*Client, error) ``` -------------------------------- ### Get CollectionName from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the collection name from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetCollectionName() string ``` -------------------------------- ### Query.GetSample Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the sample configuration for the query. ```APIDOC ## Query.GetSample ### Description Retrieves the sample configuration for the query. ### Signature ```go func (x *Query) GetSample() Sample ``` ``` -------------------------------- ### Create Qdrant Client with TLS and API Key Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2 Configure a Qdrant client for secure connection using TLS and API key authentication to a remote instance. ```go import "github.com/qdrant/go-client/qdrant" client, err := qdrant.NewClient(&qdrant.Config{ Host: "xyz-example.eu-central.aws.cloud.qdrant.io", Port: 6334, APIKey: "", UseTLS: true, // uses default config with minimum TLS version set to 1.3 // PoolSize: 3, // KeepAliveTime: 10, // KeepAliveTimeout: 2, // TLSConfig: &tls.Config{...}, // GrpcOptions: []grpc.DialOption{}, }) ``` -------------------------------- ### Get AbortTransfer from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the AbortShardTransfer object from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetAbortTransfer() *AbortShardTransfer ``` -------------------------------- ### Get Vectors Configuration Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the vector configuration for the collection. ```go func (x *UpdateCollection) GetVectorsConfig() *VectorsConfigDiff ``` -------------------------------- ### Get Optimizers Configuration Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the optimizer configuration for the collection. ```go func (x *UpdateCollection) GetOptimizersConfig() *OptimizersConfigDiff ``` -------------------------------- ### NewClient Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a new Qdrant client with a specified configuration. Supports connection pooling. ```APIDOC ## NewClient ### Description Creates a new Qdrant client with a specified configuration. Supports connection pooling. ### Method POST ### Endpoint /new ### Parameters #### Request Body - **config** (*Config) - Required - The configuration for the Qdrant client. ### Response #### Success Response (200) - **client** (*Client) - The Qdrant client instance. - **error** (error) - An error if the client creation fails. ``` -------------------------------- ### Get QueryBatchPoints Timeout Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the timeout setting from a QueryBatchPoints. ```go func (x *QueryBatchPoints) GetTimeout() uint64 ``` -------------------------------- ### Get Query Variant Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the variant type of the Query. ```go func (m *Query) GetVariant() isQuery_Variant ``` -------------------------------- ### ProductQuantization String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns the string representation of ProductQuantization. Added in v1.2.0. ```go func (x *ProductQuantization) String() string ``` -------------------------------- ### QuantizationConfig GetProduct Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the ProductQuantization configuration from QuantizationConfig. Added in v1.2.0. ```go func (x *QuantizationConfig) GetProduct() *ProductQuantization ``` -------------------------------- ### Get Query OrderBy Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the OrderBy configuration from a Query. ```go func (x *Query) GetOrderBy() *OrderBy ``` -------------------------------- ### Usage Methods Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Provides methods for accessing usage statistics, including GetHardware and GetInference. ```go func (*Usage) Descriptor() ([]byte, []int) ``` ```go func (x *Usage) GetHardware() *HardwareUsage ``` ```go func (x *Usage) GetInference() *InferenceUsage ``` ```go func (*Usage) ProtoMessage() ``` ```go func (x *Usage) ProtoReflect() protoreflect.Message ``` ```go func (x *Usage) Reset() ``` ```go func (x *Usage) String() string ``` -------------------------------- ### Get Query Formula Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the Formula associated with a Query. ```go func (x *Query) GetFormula() *Formula ``` -------------------------------- ### NewQuantizationProduct Function Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a *QuantizationConfig instance for product quantization. Added in v1.11.1. ```go func NewQuantizationProduct(product *ProductQuantization) *QuantizationConfig ``` -------------------------------- ### Get Query Discover Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the DiscoverInput associated with a Query. ```go func (x *Query) GetDiscover() *DiscoverInput ``` -------------------------------- ### Initialize PointsClient Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Constructs a new PointsClient using a gRPC client connection interface. This is the entry point for performing point-related operations. ```go func NewPointsClient(cc grpc.ClientConnInterface) PointsClient ``` -------------------------------- ### Get Query Context Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the ContextInput associated with a Query. ```go func (x *Query) GetContext() *ContextInput ``` -------------------------------- ### RecommendInput String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns a string representation of the RecommendInput. Added in v1.10.0. ```go func (x *RecommendInput) String() string ``` -------------------------------- ### Get Variant from FacetValue Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the variant type of the FacetValue. ```go func (m *FacetValue) GetVariant() isFacetValue_Variant ``` -------------------------------- ### List Aliases in Go Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Lists all aliases present in the Qdrant instance. Requires a context for the request. ```go func (c *Client) ListAliases(ctx context.Context) ([]*AliasDescription, error) ``` -------------------------------- ### Get StringValue from FacetValue Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the string value from a FacetValue. ```go func (x *FacetValue) GetStringValue() string ``` -------------------------------- ### Get IntegerValue from FacetValue Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the integer value from a FacetValue. ```go func (x *FacetValue) GetIntegerValue() int64 ``` -------------------------------- ### RecommendBatchPoints String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns a string representation of the RecommendBatchPoints object. ```go func (x *RecommendBatchPoints) String() string ``` -------------------------------- ### Usage Core Methods Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Provides core methods for Usage, including ProtoMessage, ProtoReflect, Reset, and String representations. ```go func (*Usage) ProtoMessage() ``` ```go func (x *Usage) ProtoReflect() protoreflect.Message ``` ```go func (x *Usage) Reset() ``` ```go func (x *Usage) String() string ``` -------------------------------- ### Get BoolValue from FacetValue Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the boolean value from a FacetValue. ```go func (x *FacetValue) GetBoolValue() bool ``` -------------------------------- ### Get Usage from FacetResponse Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the Usage object from a FacetResponse. ```go func (x *FacetResponse) GetUsage() *Usage ``` -------------------------------- ### Create Full Storage Snapshot Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a snapshot of the entire Qdrant storage. This is useful for full backups. The operation is asynchronous. ```go func (c *Client) CreateFullSnapshot(ctx context.Context) (*SnapshotDescription, error) ``` -------------------------------- ### ProductQuantization ProtoReflect Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns the protobuf reflection interface for ProductQuantization. Added in v1.2.0. ```go func (x *ProductQuantization) ProtoReflect() protoreflect.Message ``` -------------------------------- ### Get Time from FacetResponse Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the time associated with the FacetResponse. ```go func (x *FacetResponse) GetTime() float64 ``` -------------------------------- ### Get Summation Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the SumExpression from an Expression object. ```go func (x *Expression) GetSum() *SumExpression ``` -------------------------------- ### RecommendResponse String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns a string representation of the RecommendResponse struct. ```go func (x *RecommendResponse) String() string ``` -------------------------------- ### StartFrom Struct Definition Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Defines the StartFrom struct, which can hold different types of starting values for queries. ```go type StartFrom struct { // Types that are assignable to Value: // // *StartFrom_Float // *StartFrom_Integer // *StartFrom_Timestamp // *StartFrom_Datetime Value isStartFrom_Value `protobuf_oneof:"value"` // contains filtered or unexported fields } ``` -------------------------------- ### Get Power Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the PowExpression from an Expression object. ```go func (x *Expression) GetPow() *PowExpression ``` -------------------------------- ### StartFrom GetDatetime Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the datetime value from a StartFrom instance. ```go func (*StartFrom) GetDatetime() string ``` -------------------------------- ### Get Multiplication Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the MultExpression from an Expression object. ```go func (x *Expression) GetMult() *MultExpression ``` -------------------------------- ### File Descriptor for qdrant.proto Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant File descriptor for qdrant.proto. ```go var File_qdrant_proto protoreflect.FileDescriptor ``` -------------------------------- ### Get GeoDistance from Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the GeoDistance object from an Expression. ```go func (x *Expression) GetGeoDistance() *GeoDistance ``` -------------------------------- ### RecommendBatchResponse String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns a string representation of the RecommendBatchResponse object. ```go func (x *RecommendBatchResponse) String() string ``` -------------------------------- ### Get Division Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the DivExpression from an Expression object. ```go func (x *Expression) GetDiv() *DivExpression ``` -------------------------------- ### Get Condition from Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the Condition object from an Expression. ```go func (x *Expression) GetCondition() *Condition ``` -------------------------------- ### BinaryQuantization String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns a string representation of the BinaryQuantization configuration. ```go func (x *BinaryQuantization) String() string ``` -------------------------------- ### Get Timeout Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the timeout value for the collection update operation. ```go func (x *UpdateCollection) GetTimeout() uint64 ``` -------------------------------- ### ProductQuantization ProtoMessage Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Marks ProductQuantization as a protobuf message. Added in v1.2.0. ```go func (*ProductQuantization) ProtoMessage() ``` -------------------------------- ### Get Collection Info Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves detailed information about a specific collection. ```APIDOC ## Get Collection Info ### Description Retrieves detailed information about a specific collection. ### Method *Not specified, likely a gRPC or SDK method* ### Endpoint *Not specified, likely a gRPC or SDK method* ### Parameters #### Path Parameters *None specified* #### Query Parameters *None specified* #### Request Body - **context** (context.Context) - Required - Context for the request. - **request** (*GetCollectionInfoRequest) - Required - Request object containing the collection name. ### Request Example *Not specified* ### Response #### Success Response - **response** (*GetCollectionInfoResponse) - The detailed information about the collection. - **error** (error) - An error if the operation failed. #### Response Example *Not specified* ``` -------------------------------- ### File Descriptor for qdrant_common.proto Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant File descriptor for qdrant_common.proto. ```go var File_qdrant_common_proto protoreflect.FileDescriptor ``` -------------------------------- ### RecommendResponse ProtoReflect Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns the protobuf reflection interface for RecommendResponse. ```go func (x *RecommendResponse) ProtoReflect() protoreflect.Message ``` -------------------------------- ### Get QueryBatchPoints Read Consistency Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the ReadConsistency configuration from a QueryBatchPoints. ```go func (x *QueryBatchPoints) GetReadConsistency() *ReadConsistency ``` -------------------------------- ### Get QueryBatchPoints Query Points Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the list of QueryPoints from a QueryBatchPoints. ```go func (x *QueryBatchPoints) GetQueryPoints() []*QueryPoints ``` -------------------------------- ### NewQuantizationProduct Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a *QuantizationConfig instance from *ProductQuantization. This is used to configure product quantization. ```APIDOC ## NewQuantizationProduct ### Description Creates a QuantizationConfig for product quantization. ### Method Constructor function ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **product** (*ProductQuantization) - Required - The product quantization configuration. ### Returns - **(*QuantizationConfig)** - A pointer to the QuantizationConfig with product quantization settings. ``` -------------------------------- ### Create Recommend Query Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a Query instance for a recommendation query based on RecommendInput. ```go func NewQueryRecommend(recommend *RecommendInput) *Query ``` -------------------------------- ### Get QueryBatchPoints Collection Name Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the collection name from a QueryBatchPoints. ```go func (x *QueryBatchPoints) GetCollectionName() string ``` -------------------------------- ### StartFrom GetTimestamp Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the timestamp value from a StartFrom instance. ```go func (*StartFrom) GetTimestamp() *timestamppb.Timestamp ``` -------------------------------- ### CreateFullSnapshot Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Initiates the creation of a full snapshot of the entire Qdrant storage. This is a comprehensive backup of all collections and their data. ```APIDOC ## CreateFullSnapshot ### Description Creates a snapshot of the entire storage, including all collections. ### Method POST ### Endpoint /snapshots ### Parameters None ### Response #### Success Response (200) - **snapshot_name** (string) - The name of the created snapshot. - **created_at** (string) - The timestamp when the snapshot was created. #### Response Example ```json { "snapshot_name": "snapshot-1678886400", "created_at": "2023-03-15T10:00:00Z" } ``` ``` -------------------------------- ### Get Query Fusion Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the Fusion configuration associated with a Query. ```go func (x *Query) GetFusion() Fusion ``` -------------------------------- ### Get Payload from PointsUpdateOperation_SetPayload Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the payload map associated with a PointsUpdateOperation_SetPayload. ```go func (x *PointsUpdateOperation_SetPayload) GetPayload() map[string]*Value ``` -------------------------------- ### ContextExamplePair.ProtoReflect Method Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Returns the reflection descriptor for ContextExamplePair. Added in v1.7.0. ```go func (x *ContextExamplePair) ProtoReflect() protoreflect.Message ``` -------------------------------- ### Check Qdrant Client and Server Version Compatibility Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Use this function to determine if the client version is compatible with the server version. ```go func IsCompatible(clientVersion, serverVersion string) bool ``` -------------------------------- ### Get HasIdCondition HasId Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the list of PointIds associated with the HasIdCondition. ```go func (x *HasIdCondition) GetHasId() []*PointId ``` -------------------------------- ### Get Hits from FacetResponse Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the list of FacetHit objects from a FacetResponse. ```go func (x *FacetResponse) GetHits() []*FacetHit ``` -------------------------------- ### WalConfigDiff String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns a string representation of the WalConfigDiff. ```go func (x *WalConfigDiff) String() string ``` -------------------------------- ### Create Custom GrpcClient Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Creates a new gRPC client with custom configuration. Allows for specific client settings. ```go func NewGrpcClient(config *Config) (*GrpcClient, error) ``` -------------------------------- ### Get Negation Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the negation Expression from an Expression object. ```go func (x *Expression) GetNeg() *Expression ``` -------------------------------- ### RecommendPoints ProtoReflect Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns the protobuf reflection interface for RecommendPoints. ```go func (x *RecommendPoints) ProtoReflect() protoreflect.Message ``` -------------------------------- ### Get Exponential Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the exponential Expression from an Expression object. ```go func (x *Expression) GetExp() *Expression ``` -------------------------------- ### Get Datetime Key from Expression Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the datetime key from an Expression. ```go func (x *Expression) GetDatetimeKey() string ``` -------------------------------- ### StartFrom GetFloat Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the float value from a StartFrom instance. ```go func (*StartFrom) GetFloat() float64 ``` -------------------------------- ### Get Timeout for CreateCollection Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the timeout value for a CreateCollection object. ```go func (x *CreateCollection) GetTimeout() uint64 ``` -------------------------------- ### Create Collection Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Placeholder for Create Collection RPC. Implement this method to handle collection creation requests. ```go func (UnimplementedCollectionsServer) Create(context.Context, *CreateCollection) (*CollectionOperationResponse, error) ``` -------------------------------- ### RecommendPoints String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns a string representation of the RecommendPoints struct. ```go func (x *RecommendPoints) String() string ``` -------------------------------- ### Get ShardNumber for CollectionParams Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the number of shards configured for a collection. ```go func (x *CollectionParams) GetShardNumber() uint32 ``` -------------------------------- ### Sample String Method Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Returns the string representation of the enum. Added in v1.11.0. ```go func (x Sample) String() string ``` -------------------------------- ### RecommendBatch Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Performs batch recommendations using multiple sets of positive and negative examples. This is efficient for generating recommendations for multiple users or items simultaneously. ```APIDOC ## RecommendBatch Points ### Description Performs batch recommendations using multiple sets of positive and negative examples. ### Method POST (Assumed based on typical API patterns for batch operations) ### Endpoint /collections/{collection_name}/points/recommend_batch ### Parameters #### Request Body - **collection_name** (string) - Required - The name of the collection to recommend from. - **recommendations** (array) - Required - A list of recommendation requests. - **positive** (array) - Required - A list of point IDs that are considered positive examples. - **negative** (array) - Optional - A list of point IDs that are considered negative examples. - **query_vector** (array) - Optional - A vector to use for recommendations. If not provided, it will be inferred from the positive examples. - **limit** (integer) - Required - The maximum number of recommendations to return. - **filter** (object) - Optional - A filter to apply to the recommendation results. - **with_payload** (boolean) - Optional - Whether to include payload in the response. - **with_vectors** (boolean) - Optional - Whether to include vectors in the response. ### Request Example ```json { "collection_name": "my_collection", "recommendations": [ { "positive": ["user1_positive_1"], "negative": ["user1_negative_1"], "limit": 5 }, { "positive": ["user2_positive_1", "user2_positive_2"], "limit": 5, "with_payload": true } ] } ``` ### Response #### Success Response (200) - **status** (string) - The status of the operation. - **result** (object) - The batch recommendation results. #### Response Example ```json { "status": "ok", "result": { "results": [ { "points": [ { "id": "rec_point_1_1", "payload": {}, "score": 0.99 } ] }, { "points": [ { "id": "rec_point_2_1", "payload": {}, "score": 0.97 } ] } ] } } ``` ``` -------------------------------- ### DefaultClient Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Instantiates a new client with the default configuration. Connects to localhost:6334 with TLS disabled. ```APIDOC ## DefaultClient ### Description Instantiates a new client with the default configuration. Connects to localhost:6334 with TLS disabled. ### Method GET ### Endpoint /default ### Response #### Success Response (200) - **client** (*Client) - The Qdrant client instance. - **error** (error) - An error if the client creation fails. ``` -------------------------------- ### ContextExamplePair.GetNegative Method Source: https://pkg.go.dev/github.com/qdrant/go-client%40v1.16.2/qdrant Retrieves the negative example vector from a ContextExamplePair. Added in v1.7.0. ```go func (x *ContextExamplePair) GetNegative() *VectorExample ``` -------------------------------- ### Get DropReplica from UpdateCollectionClusterSetupRequest Source: https://pkg.go.dev/github.com/qdrant/go-client@v1.16.2/qdrant Retrieves the Replica object for dropping a replica from the UpdateCollectionClusterSetupRequest. ```go func (x *UpdateCollectionClusterSetupRequest) GetDropReplica() *Replica ```