search

package
v1.0.0-beta.33 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlattenObjects

func FlattenObjects(data map[string]any) map[string]any

func MutateSearchDocument

func MutateSearchDocument(index *schema.SearchIndex, decData map[string]any) (map[string]any, error)

func UnFlattenObjects

func UnFlattenObjects(flat map[string]any) map[string]any

func UnpackSearchFields

func UnpackSearchFields(index *schema.SearchIndex, doc map[string]any) (map[string]any, error)

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)

Run ... ToDo: Test batch documents failure on duplicates.

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 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 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) *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) GetUpdateQueryRunner

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

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, versionH *metadata.VersionHandler) *SessionManager

func (*SessionManager) Execute

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

func (*SessionManager) TxExecute

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

type Streaming

type Streaming interface{}

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