search

package
v1.0.0-alpha.32 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateEntity = NewSearchError(http.StatusConflict, ErrCodeDuplicate, "entity already exists")
	ErrNotFound        = NewSearchError(http.StatusNotFound, ErrCodeNotFound, "not found")
)

Functions

func IsSearchError

func IsSearchError(err error) bool

func NewSearchError

func NewSearchError(httpCode int, code ErrCode, msg string, args ...interface{}) error

Types

type ErrCode

type ErrCode byte
const (
	ErrCodeInvalid           ErrCode = 0x00
	ErrCodeDuplicate         ErrCode = 0x01
	ErrCodeNotFound          ErrCode = 0x02
	ErrCodeIndexingDocuments ErrCode = 0x03
	ErrCodeUnhandled         ErrCode = 0x04
)

type Error

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

func (Error) Error

func (se Error) Error() string

type IndexDocumentsOptions

type IndexDocumentsOptions struct {
	Action    string
	BatchSize int
}

type NoopStore

type NoopStore struct{}

func (*NoopStore) CreateCollection

func (n *NoopStore) CreateCollection(context.Context, *tsApi.CollectionSchema) error

func (*NoopStore) DeleteDocuments

func (n *NoopStore) DeleteDocuments(context.Context, string, string) error

func (*NoopStore) DropCollection

func (n *NoopStore) DropCollection(context.Context, string) error

func (*NoopStore) IndexDocuments

func (*NoopStore) Search

func (*NoopStore) UpdateCollection

type Store

type Store interface {
	CreateCollection(ctx context.Context, schema *tsApi.CollectionSchema) error
	UpdateCollection(ctx context.Context, name string, schema *tsApi.CollectionUpdateSchema) error
	DropCollection(ctx context.Context, table string) error
	IndexDocuments(ctx context.Context, table string, documents io.Reader, options IndexDocumentsOptions) error
	DeleteDocuments(ctx context.Context, table string, key string) error
	Search(ctx context.Context, table string, query *qsearch.Query, pageNo int) ([]tsApi.SearchResult, error)
}

func NewStore

func NewStore(config *config.SearchConfig) (Store, error)

func NewStoreWithMetrics

func NewStoreWithMetrics(config *config.SearchConfig) (Store, error)

Jump to

Keyboard shortcuts

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