server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address    string
	TLSEnabled bool
	TLSCert    string
	TLSKey     string
}

Config provides configuration parameters for running a Server.

type Server

type Server struct {
	grpcapi.UnimplementedServerServer
	// contains filtered or unexported fields
}

Server is the main implementation of HNSW gRPC server.

func New

func New(config Config, indexManager *indexmanager.IndexManager, logger zerolog.Logger) *Server

New creates a new Server.

func (*Server) CreateIndex

func (s *Server) CreateIndex(_ context.Context, req *grpcapi.CreateIndexRequest) (*emptypb.Empty, error)

CreateIndex makes a new index.

func (*Server) DeleteIndex

func (s *Server) DeleteIndex(_ context.Context, req *grpcapi.DeleteIndexRequest) (*emptypb.Empty, error)

DeleteIndex removes an index.

func (*Server) FlushIndex

func (s *Server) FlushIndex(_ context.Context, req *grpcapi.FlushRequest) (*emptypb.Empty, error)

FlushIndex flushes the index to file.

func (*Server) Indices

Indices returns the list of indices.

func (*Server) InsertVector

InsertVector inserts a new vector in the given index.

func (*Server) InsertVectorWithId

InsertVectorWithId inserts a new vector in the given index.

func (*Server) InsertVectors

func (s *Server) InsertVectors(stream grpcapi.Server_InsertVectorsServer) error

InsertVectors inserts the new vectors in the given index. It flushes the index at each batch.

func (*Server) InsertVectorsWithIds

func (s *Server) InsertVectorsWithIds(stream grpcapi.Server_InsertVectorsWithIdsServer) error

InsertVectorsWithIds inserts the new vectors in the given index. It flushes the index at each batch.

func (*Server) Run

func (s *Server) Run() error

Run runs the server according to the configuration.

func (*Server) SearchKNN

SearchKNN returns the top k nearest neighbors to the query, searching on the given index.

func (*Server) SetEf

func (s *Server) SetEf(_ context.Context, req *grpcapi.SetEfRequest) (*emptypb.Empty, error)

SetEf sets the `ef` parameter for the given index.

Jump to

Keyboard shortcuts

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