indexer

package
v0.0.0-...-e97be17 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexerClient

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

IndexerClient provides an API compatible with the index.Indexer interface for accessing a text indexer instances exposed by a remote gRPC server.

func NewIndexerClient

func NewIndexerClient(ctx context.Context, rpcClient proto.IndexerClient) *IndexerClient

NewIndexerClient returns a new client instance that implements a subset of the index.Indexer interface by delegating methods to an indexer instance exposed by a remote gRPC sever.

func (*IndexerClient) Index

func (c *IndexerClient) Index(doc *indexer.Document) error

func (*IndexerClient) Search

func (c *IndexerClient) Search(query indexer.Query) (indexer.Iterator, error)

func (*IndexerClient) UpdateScore

func (c *IndexerClient) UpdateScore(linkID uuid.UUID, score float64) error

type IndexerServer

type IndexerServer struct {
	proto.UnimplementedIndexerServer
	// contains filtered or unexported fields
}

IndexerServer provides a gRPC layer for indexing and querying documents.

func NewIndexerServer

func NewIndexerServer(i indexer.Indexer) *IndexerServer

NewIndexerServer creates a new server instance that uses the provided indexer as its backing store.

func (*IndexerServer) Index

Index inserts a new document to the index or updates the index entry for and existing document.

func (*IndexerServer) Search

Search the index for a particular query and stream the results back to the client. The first response will include the total result count while all subsequent responses will include documents from the resultset.

func (*IndexerServer) UpdateScore

func (s *IndexerServer) UpdateScore(_ context.Context, req *proto.UpdateScoreRequest) (*empty.Empty, error)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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