Documentation ¶
Index ¶
- type TextIndexerClient
- type TextIndexerServer
- func (s *TextIndexerServer) Index(_ context.Context, req *proto.Document) (*proto.Document, error)
- func (s *TextIndexerServer) Search(req *proto.Query, w proto.TextIndexer_SearchServer) error
- func (s *TextIndexerServer) UpdateScore(_ context.Context, req *proto.UpdateScoreRequest) (*empty.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TextIndexerClient ¶
type TextIndexerClient struct {
// contains filtered or unexported fields
}
TextIndexerClient provides an API compatible with the index.Indexer interface for accessing a text indexer instances exposed by a remote gRPC server.
func NewTextIndexerClient ¶
func NewTextIndexerClient(ctx context.Context, rpcClient proto.TextIndexerClient) *TextIndexerClient
NewTextIndexerClient 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 (*TextIndexerClient) Index ¶
func (c *TextIndexerClient) Index(doc *index.Document) error
Index inserts a new document to the index or updates the index entry for and existing document.
func (*TextIndexerClient) Search ¶
Search the index for a particular query and return back a result iterator.
func (*TextIndexerClient) UpdateScore ¶
func (c *TextIndexerClient) UpdateScore(linkID uuid.UUID, score float64) error
UpdateScore updates the PageRank score for a document with the specified link ID.
type TextIndexerServer ¶
type TextIndexerServer struct {
// contains filtered or unexported fields
}
TextIndexerServer provides a gRPC layer for indexing and querying documents.
func NewTextIndexerServer ¶
func NewTextIndexerServer(i index.Indexer) *TextIndexerServer
NewTextIndexerServer creates a new server instance that uses the provided indexer as its backing store.
func (*TextIndexerServer) Index ¶
Index inserts a new document to the index or updates the index entry for and existing document.
func (*TextIndexerServer) Search ¶
func (s *TextIndexerServer) Search(req *proto.Query, w proto.TextIndexer_SearchServer) error
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 (*TextIndexerServer) UpdateScore ¶
func (s *TextIndexerServer) UpdateScore(_ context.Context, req *proto.UpdateScoreRequest) (*empty.Empty, error)
UpdateScore updates the PageRank score for a document with the specified link ID.