Documentation
¶
Index ¶
Constants ¶
View Source
const ( ElasticSearch OpenSearch )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configurator ¶
type Doc ¶
type Doc map[types.ColumnName]interface{}
type FunctionScore ¶
type FunctionScore struct {
Query BoolQuery `json:"query"`
Functions []FunctionSyntax `json:"functions"`
BoostMode string `json:"boost_mode"`
MinScore float64 `json:"min_score"`
}
type FunctionScoreQuery ¶
type FunctionScoreQuery struct {
FunctionScore FunctionScore `json:"function_score"`
}
type FunctionSyntax ¶
type FunctionSyntax struct {
ScriptScore ScriptScore `json:"script_score"`
}
type Query ¶
type Query[R interface{}] struct {
Size int64 `json:"size,omitempty"`
Query FunctionScoreQuery `json:"query,omitempty"`
Source []string `json:"_source,omitempty"`
Sort []any `json:"sort,omitempty"`
After *R `json:"search_after,omitempty"`
}
type Result ¶
type ScriptScore ¶
type ScriptScore struct {
Script Script `json:"script"`
}
type Searcher ¶
type Searcher interface {
SearchRaw(ctxt context.Context, index string, query any, result any) error
Create(ctxt context.Context, index string, doc *Doc, result *Result) (error, Warn)
Update(ctxt context.Context, index string, doc *Doc, result *Result) (error, Warn)
Delete(ctxt context.Context, index string, doc *Doc, result *Result) (error, Warn)
BulkDelete(ctxt context.Context, index string, ids []*string, result *Result) (error, Warn)
CreateIndex(ctxt context.Context, index string, schema string, result *Result) (error, Warn)
}
func New ¶
func New(c Configurator) Searcher
func NewElasticSearchClient ¶
func NewElasticSearchClient(configurator Configurator) Searcher
type TypedSearcher ¶
type TypedSearcher[T interface{}, R interface{}] interface {
Search(ctxt context.Context, index string, query any) (*Records[T, R], error)
SearchFunction(context.Context, string, *string, *map[string]interface{}, *map[string]interface{}, []string, []any) (*Records[T, R], error)
SearchFunctionContinuous(context.Context, string, *string, *map[string]interface{}, *map[string]interface{}, []string, []any, *Records[T, R]) (*Records[T, R], error)
ContinuousSearchByFunctionWithScriptID(ctxt context.Context, index string, scrollSize int64, source []string, sorts []any, scriptId *string, cond *map[string]interface{}, params *map[string]interface{}, result *Records[T, R]) (*Records[T, R], error)
}
func NewTypedSearcher ¶
func NewTypedSearcher[T, R interface{}](searcher Searcher) TypedSearcher[T, R]
type UpdateDocument ¶
type UpdateDocument struct {
Doc Doc `json:"doc"`
}
Click to show internal directories.
Click to hide internal directories.