Documentation ¶
Index ¶
- Constants
- func IsErrDuplicateEntity(err error) bool
- func IsErrDuplicateFieldNames(err error) bool
- func IsErrNotFound(err error) bool
- func NewSearchError(httpCode int, code ErrCode, msg string, args ...any) error
- type ErrCode
- type Error
- type IndexAction
- type IndexDocumentsOptions
- type IndexResp
- type NoopStore
- func (*NoopStore) AllCollections(context.Context) (map[string]*tsApi.CollectionResponse, error)
- func (*NoopStore) CreateCollection(context.Context, *tsApi.CollectionSchema) error
- func (*NoopStore) CreateDocument(_ context.Context, _ string, _ map[string]any) error
- func (*NoopStore) DeleteDocument(context.Context, string, string) error
- func (*NoopStore) DeleteDocuments(context.Context, string, *filter.WrappedFilter) (int, error)
- func (*NoopStore) DescribeCollection(context.Context, string) (*tsApi.CollectionResponse, error)
- func (*NoopStore) DropCollection(context.Context, string) error
- func (*NoopStore) GetDocuments(_ context.Context, _ string, _ []string) (*tsApi.SearchResult, error)
- func (*NoopStore) IndexDocuments(context.Context, string, io.Reader, IndexDocumentsOptions) ([]IndexResp, error)
- func (*NoopStore) Search(context.Context, string, *qsearch.Query, int) ([]tsApi.SearchResult, error)
- func (*NoopStore) UpdateCollection(context.Context, string, *tsApi.CollectionUpdateSchema) error
- type Store
Constants ¶
View Source
const StreamContentType = "application/x-json-stream"
Variables ¶
This section is empty.
Functions ¶
func IsErrDuplicateEntity ¶
func IsErrNotFound ¶
Types ¶
type IndexAction ¶
type IndexAction string
var ( Create IndexAction = "create" Replace IndexAction = "upsert" Update IndexAction = "update" )
type IndexDocumentsOptions ¶
type IndexDocumentsOptions struct { Action IndexAction BatchSize int }
type NoopStore ¶
type NoopStore struct{}
func (*NoopStore) AllCollections ¶
func (*NoopStore) CreateCollection ¶
func (*NoopStore) CreateDocument ¶
func (*NoopStore) DeleteDocument ¶
func (*NoopStore) DeleteDocuments ¶
func (*NoopStore) DescribeCollection ¶
func (*NoopStore) GetDocuments ¶
func (*NoopStore) IndexDocuments ¶
func (*NoopStore) UpdateCollection ¶
type Store ¶
type Store interface { // AllCollections is to describe all search indexes. AllCollections(ctx context.Context) (map[string]*tsApi.CollectionResponse, error) // DescribeCollection is to describe a search index. DescribeCollection(ctx context.Context, name string) (*tsApi.CollectionResponse, error) // CreateCollection is to create a search index. CreateCollection(ctx context.Context, schema *tsApi.CollectionSchema) error // UpdateCollection is to update the search index. UpdateCollection(ctx context.Context, name string, schema *tsApi.CollectionUpdateSchema) error // DropCollection is to drop the search index. DropCollection(ctx context.Context, table string) error // CreateDocument is to create and index a single document CreateDocument(_ context.Context, table string, doc map[string]any) error // IndexDocuments is to index batch of documents. It expects index action to decide whether it needs to create/upsert/update documents. IndexDocuments(ctx context.Context, table string, documents io.Reader, options IndexDocumentsOptions) ([]IndexResp, error) // bytes written - bytes from io.Reader // DeleteDocument is deleting a single document using id. DeleteDocument(ctx context.Context, table string, key string) error // DeleteDocuments is to delete multiple documents using filter. DeleteDocuments(ctx context.Context, table string, filter *filter.WrappedFilter) (int, error) // Search is to search using Query. Search(ctx context.Context, table string, query *qsearch.Query, pageNo int) ([]tsApi.SearchResult, error) // GetDocuments is to get a single or multiple documents by id. GetDocuments(ctx context.Context, table string, ids []string) (*tsApi.SearchResult, error) }
Click to show internal directories.
Click to hide internal directories.