Documentation ¶
Overview ¶
Allows to evaluate the quality of ranked search results over a set of typical search queries
Index ¶
- Variables
- type NewRankEval
- type RankEval
- func (r *RankEval) AllowNoIndices(allownoindices bool) *RankEval
- func (r RankEval) Do(providedCtx context.Context) (*Response, error)
- func (r *RankEval) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *RankEval
- func (r *RankEval) Header(key, value string) *RankEval
- func (r *RankEval) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *RankEval) IgnoreUnavailable(ignoreunavailable bool) *RankEval
- func (r *RankEval) Index(index string) *RankEval
- func (r *RankEval) Metric(metric *types.RankEvalMetric) *RankEval
- func (r RankEval) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *RankEval) Raw(raw io.Reader) *RankEval
- func (r *RankEval) Request(req *Request) *RankEval
- func (r *RankEval) Requests(requests ...types.RankEvalRequestItem) *RankEval
- func (r *RankEval) SearchType(searchtype string) *RankEval
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewRankEval ¶
type NewRankEval func() *RankEval
NewRankEval type alias for index.
func NewRankEvalFunc ¶
func NewRankEvalFunc(tp elastictransport.Interface) NewRankEval
NewRankEvalFunc returns a new instance of RankEval with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type RankEval ¶
type RankEval struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *RankEval
Allows to evaluate the quality of ranked search results over a set of typical search queries
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-rank-eval.html
func (*RankEval) AllowNoIndices ¶
AllowNoIndices If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. API name: allow_no_indices
func (RankEval) Do ¶
Do runs the request through the transport, handle the response and returns a rankeval.Response
func (*RankEval) ExpandWildcards ¶
func (r *RankEval) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *RankEval
ExpandWildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. API name: expand_wildcards
func (*RankEval) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*RankEval) IgnoreUnavailable ¶
IgnoreUnavailable If `true`, missing or closed indices are not included in the response. API name: ignore_unavailable
func (*RankEval) Index ¶
Index Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard (`*`) expressions are supported. To target all data streams and indices in a cluster, omit this parameter or use `_all` or `*`. API Name: index
func (*RankEval) Metric ¶ added in v8.9.0
func (r *RankEval) Metric(metric *types.RankEvalMetric) *RankEval
Metric Definition of the evaluation metric to calculate. API name: metric
func (RankEval) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*RankEval) Raw ¶
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*RankEval) Requests ¶ added in v8.9.0
func (r *RankEval) Requests(requests ...types.RankEvalRequestItem) *RankEval
Requests A set of typical search requests, together with their provided ratings. API name: requests
func (*RankEval) SearchType ¶
SearchType Search operation type API name: search_type
type Request ¶
type Request struct { // Metric Definition of the evaluation metric to calculate. Metric *types.RankEvalMetric `json:"metric,omitempty"` // Requests A set of typical search requests, together with their provided ratings. Requests []types.RankEvalRequestItem `json:"requests"` }
Request holds the request body struct for the package rankeval
type Response ¶ added in v8.7.0
type Response struct { // Details The details section contains one entry for every query in the original // requests section, keyed by the search request id Details map[string]types.RankEvalMetricDetail `json:"details"` Failures map[string]json.RawMessage `json:"failures"` // MetricScore The overall evaluation quality calculated by the defined metric MetricScore types.Float64 `json:"metric_score"` }
Response holds the response body struct for the package rankeval