qdrant

package module
v0.0.0-...-573fe8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, config *Config) (*Client, error)

NewClient creates a new client with the given configuration

func NewClientFromGrpc

func NewClientFromGrpc(grpcClient *GrpcClient) *Client

func (*Client) Close

func (c *Client) Close() error

Closes the gRPC connection if it exists

func (*Client) Count

func (c *Client) Count(ctx context.Context, collectionName string, opts ...CountPointsOption) (uint64, error)

Returns the number of points in the given collection. Optionally, a filter can be applied.

func (*Client) CreateCollection

func (c *Client) CreateCollection(ctx context.Context, name string, opts ...CreateCollectionOption) error

Creates a new Qdrant collection with the given name and options

func (*Client) DeleteCollection

func (c *Client) DeleteCollection(ctx context.Context, name string, opts ...DeleteCollectionOption) error

func (*Client) Grpc

func (c *Client) Grpc() *GrpcClient

func (*Client) ListCollections

func (c *Client) ListCollections(ctx context.Context) ([]string, error)

Lists all the collections in the Qdrant instance

func (*Client) Upsert

func (c *Client) Upsert(ctx context.Context, collectionName string, opts ...UpsertPointsOption) (*grpc.UpdateResult, error)

Performs an upsert operation on the given collection

func (*Client) UpsertPoints

func (c *Client) UpsertPoints(ctx context.Context, collectionName string, points ...*grpc.PointStruct) (*grpc.UpdateResult, error)

type Config

type Config struct {
	Host string
	Port int

	ApiToken string

	UseTls bool

	GrpcOptions []grpc.DialOption
	// contains filtered or unexported fields
}

func (*Config) GetAddr

func (c *Config) GetAddr() string

func (*Config) GetTransportCreds

func (c *Config) GetTransportCreds() grpc.DialOption

type CountPointsOption

type CountPointsOption func(c *grpc.CountPoints)

func WithCountConsistency

func WithCountConsistency(consistency grpc.ReadConsistencyType) CountPointsOption

func WithCountExact

func WithCountExact(exact bool) CountPointsOption

func WithCountFilter

func WithCountFilter(filter *grpc.Filter) CountPointsOption

func WithCountShardKeySelector

func WithCountShardKeySelector(selector *grpc.ShardKeySelector) CountPointsOption

type CreateCollectionOption

type CreateCollectionOption func(c *qdrant.CreateCollection)

============ BEGIN CREATE COLLECTION OPTIONS ==============

func WithBinaryQuantization

func WithBinaryQuantization(config *qdrant.BinaryQuantization) CreateCollectionOption

func WithCreateTimeout

func WithCreateTimeout(timeout uint64) CreateCollectionOption

func WithHnswConfig

func WithHnswConfig(config *qdrant.HnswConfigDiff) CreateCollectionOption

func WithInitFromCollection

func WithInitFromCollection(collection string) CreateCollectionOption

func WithOnDiskPayload

func WithOnDiskPayload(value bool) CreateCollectionOption

func WithProductQuantization

func WithProductQuantization(config *qdrant.ProductQuantization) CreateCollectionOption

func WithReplicationFactor

func WithReplicationFactor(factor uint32) CreateCollectionOption

func WithScalarQuantization

func WithScalarQuantization(config *qdrant.ScalarQuantization) CreateCollectionOption

func WithShardNumber

func WithShardNumber(number uint32) CreateCollectionOption

func WithShardingMethod

func WithShardingMethod(method qdrant.ShardingMethod) CreateCollectionOption

func WithSparseVectorsConfig

func WithSparseVectorsConfig(params map[string]*qdrant.SparseVectorParams) CreateCollectionOption

func WithVectorConfig

func WithVectorConfig(params *qdrant.VectorParams) CreateCollectionOption

func WithVectorConfigMap

func WithVectorConfigMap(params map[string]*qdrant.VectorParams) CreateCollectionOption

func WithWalConfig

func WithWalConfig(config *qdrant.WalConfigDiff) CreateCollectionOption

func WithWriteConsistencyFactor

func WithWriteConsistencyFactor(factor uint32) CreateCollectionOption

type DeleteCollectionOption

type DeleteCollectionOption func(c *qdrant.DeleteCollection)

============ BEGIN DELETE COLLECTION OPTIONS ==============

func WithDeleteTimeout

func WithDeleteTimeout(timeout uint64) DeleteCollectionOption

type GrpcClient

type GrpcClient struct {
	Qdrant      qdrant.QdrantClient
	Collections qdrant.CollectionsClient
	Points      qdrant.PointsClient
	Snapshots   qdrant.SnapshotsClient
	// contains filtered or unexported fields
}

func NewGrpcClient

func NewGrpcClient(ctx context.Context, config *Config) (*GrpcClient, error)

connect connect to Service

func NewGrpcClientFromConn

func NewGrpcClientFromConn(conn *grpc.ClientConn) *GrpcClient

func (*GrpcClient) Close

func (c *GrpcClient) Close() error

Close close the connection

type UpsertPointsOption

type UpsertPointsOption func(c *grpc.UpsertPoints)

func WithPoints

func WithPoints(points []*grpc.PointStruct) UpsertPointsOption

func WithUpsertOrdering

func WithUpsertOrdering(ordering grpc.WriteOrderingType) UpsertPointsOption

func WithUpsertShardKeySelector

func WithUpsertShardKeySelector(shardKeys []*grpc.ShardKey) UpsertPointsOption

func WithUpsertWait

func WithUpsertWait(wait bool) UpsertPointsOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL