search

package
v1.0.0-beta.80 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOrReplaceRunner

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

func (*CreateOrReplaceRunner) Run

func (runner *CreateOrReplaceRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

type CreateRunner

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

func (*CreateRunner) Run

func (runner *CreateRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

func (*CreateRunner) SetCreateByIdReq

func (runner *CreateRunner) SetCreateByIdReq(req *api.CreateByIdRequest)

func (*CreateRunner) SetCreateDocumentsReq

func (runner *CreateRunner) SetCreateDocumentsReq(req *api.CreateDocumentRequest)

type DeleteRunner

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

func (*DeleteRunner) Run

func (runner *DeleteRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

func (*DeleteRunner) SetDeleteByQueryReq

func (runner *DeleteRunner) SetDeleteByQueryReq(req *api.DeleteByQueryRequest)

func (*DeleteRunner) SetDeleteDocumentReq

func (runner *DeleteRunner) SetDeleteDocumentReq(req *api.DeleteDocumentRequest)

type FilterableSearchIterator

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

func NewFilterableSearchIterator

func NewFilterableSearchIterator(index *schema.SearchIndex, reader *pageReader, filter *filter.WrappedFilter, singlePage bool) *FilterableSearchIterator

func (*FilterableSearchIterator) Interrupted

func (it *FilterableSearchIterator) Interrupted() error

func (*FilterableSearchIterator) Next

func (it *FilterableSearchIterator) Next(row *ResultRow) bool

type IndexRunner

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

func (*IndexRunner) Run

func (runner *IndexRunner) Run(ctx context.Context, tx transaction.Tx, tenant *metadata.Tenant) (Response, error)

func (*IndexRunner) SetCreateIndexReq

func (runner *IndexRunner) SetCreateIndexReq(create *api.CreateOrUpdateIndexRequest)

func (*IndexRunner) SetDeleteIndexReq

func (runner *IndexRunner) SetDeleteIndexReq(drop *api.DeleteIndexRequest)

func (*IndexRunner) SetGetIndexReq

func (runner *IndexRunner) SetGetIndexReq(get *api.GetIndexRequest)

func (*IndexRunner) SetListIndexesReq

func (runner *IndexRunner) SetListIndexesReq(list *api.ListIndexesRequest)

type ReadRunner

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

func (*ReadRunner) Run

func (runner *ReadRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

type Response

type Response struct {
	api.Response

	Status string
}

type ResultRow

type ResultRow struct {
	Group []string
	Rows  []*Row
}

ResultRow is either a single Row(hit) or a batch of Row(hits) in case of group_by.

type Row

type Row struct {
	CreatedAt *internal.Timestamp
	UpdatedAt *internal.Timestamp
	Document  []byte
	Match     *api.Match
}

Row represents a single hit. This is used by the runner to finally push the row out.

type Runner

type Runner interface {
	Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)
}

type RunnerFactory

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

func NewRunnerFactory

func NewRunnerFactory(store search.Store, encoder metadata.Encoder, txMgr *transaction.Manager) *RunnerFactory

NewRunnerFactory returns RunnerFactory object.

func (*RunnerFactory) GetCreateOrReplaceRunner

func (f *RunnerFactory) GetCreateOrReplaceRunner(r *api.CreateOrReplaceDocumentRequest, accessToken *types.AccessToken) *CreateOrReplaceRunner

func (*RunnerFactory) GetCreateRunner

func (f *RunnerFactory) GetCreateRunner(accessToken *types.AccessToken) *CreateRunner

func (*RunnerFactory) GetDeleteQueryRunner

func (f *RunnerFactory) GetDeleteQueryRunner(accessToken *types.AccessToken) *DeleteRunner

func (*RunnerFactory) GetIndexRunner

func (f *RunnerFactory) GetIndexRunner(accessToken *types.AccessToken) *IndexRunner

func (*RunnerFactory) GetReadRunner

func (f *RunnerFactory) GetReadRunner(r *api.GetDocumentRequest, accessToken *types.AccessToken) *ReadRunner

func (*RunnerFactory) GetSearchRunner

func (f *RunnerFactory) GetSearchRunner(r *api.SearchIndexRequest, streaming Streaming, accessToken *types.AccessToken) *SearchRunner

func (*RunnerFactory) GetUpdateQueryRunner

func (f *RunnerFactory) GetUpdateQueryRunner(r *api.UpdateDocumentRequest, accessToken *types.AccessToken) *UpdateRunner

type SearchReader

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

SearchReader is responsible for iterating on the search results. It uses pageReader internally to read page and then iterate on documents inside hits.

func NewSearchReader

func NewSearchReader(ctx context.Context, store search.Store, index *schema.SearchIndex, query *qsearch.Query) *SearchReader

func (*SearchReader) Iterator

func (reader *SearchReader) Iterator(index *schema.SearchIndex, filter *filter.WrappedFilter) *FilterableSearchIterator

func (*SearchReader) SinglePageIterator

func (reader *SearchReader) SinglePageIterator(index *schema.SearchIndex, filter *filter.WrappedFilter, pageNo int32) *FilterableSearchIterator

type SearchRunner

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

func (*SearchRunner) Run

func (runner *SearchRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

type Session

type Session interface {
	// Execute executes the request using the query runner
	Execute(ctx context.Context, runner Runner) (Response, error)

	// TxExecute executes in a fdb transaction. This is mainly used to manage search indexes. This metadata
	// is stored in fdb as part of project metadata and that modification is a transactional operation. This API
	// is automatically bumping up the metadata version as this should only be used for metadata operation.
	TxExecute(ctx context.Context, runner TxRunner) (Response, error)
}

type SessionManager

type SessionManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSessionManager

func NewSessionManager(txMgr *transaction.Manager, tenantMgr *metadata.TenantManager, tenantTracker *metadata.CacheTracker) *SessionManager

func (*SessionManager) Execute

func (sessions *SessionManager) Execute(ctx context.Context, runner Runner) (Response, error)

func (*SessionManager) TrackVersion

func (sessions *SessionManager) TrackVersion(ctx context.Context, tenant *metadata.Tenant) error

func (*SessionManager) TxExecute

func (sessions *SessionManager) TxExecute(ctx context.Context, runner TxRunner) (Response, error)

type Streaming

type Streaming interface {
	api.Search_SearchServer
}

type TxRunner

type TxRunner interface {
	Run(ctx context.Context, tx transaction.Tx, tenant *metadata.Tenant) (Response, error)
}

type UpdateRunner

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

func (*UpdateRunner) Run

func (runner *UpdateRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

Jump to

Keyboard shortcuts

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