explain
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Explain a document match result.Get information about why a specific document matches, or doesn't match, aquery.It computes a score explanation for a query and a specific document.
Index¶
- Variables
- type Explain
- func (r *Explain) AnalyzeWildcard(analyzewildcard bool) *Explain
- func (r *Explain) Analyzer(analyzer string) *Explain
- func (r *Explain) DefaultOperator(defaultoperator operator.Operator) *Explain
- func (r *Explain) Df(df string) *Explain
- func (r Explain) Do(providedCtx context.Context) (*Response, error)
- func (r *Explain) ErrorTrace(errortrace bool) *Explain
- func (r *Explain) FilterPath(filterpaths ...string) *Explain
- func (r *Explain) Header(key, value string) *Explain
- func (r *Explain) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Explain) Human(human bool) *Explain
- func (r *Explain) Lenient(lenient bool) *Explain
- func (r Explain) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Explain) Preference(preference string) *Explain
- func (r *Explain) Pretty(pretty bool) *Explain
- func (r *Explain) Q(q string) *Explain
- func (r *Explain) Query(query *types.Query) *Explain
- func (r *Explain) Raw(raw io.Reader) *Explain
- func (r *Explain) Request(req *Request) *Explain
- func (r *Explain) Routing(routing string) *Explain
- func (r *Explain) SourceExcludes_(fields ...string) *Explain
- func (r *Explain) SourceIncludes_(fields ...string) *Explain
- func (r *Explain) Source_(sourceconfigparam string) *Explain
- func (r *Explain) StoredFields(fields ...string) *Explain
- type NewExplain
- 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¶
typeExplain¶
type Explain struct {// contains filtered or unexported fields}funcNew¶
func New(tpelastictransport.Interface) *Explain
Explain a document match result.Get information about why a specific document matches, or doesn't match, aquery.It computes a score explanation for a query and a specific document.
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html
func (*Explain)AnalyzeWildcard¶
AnalyzeWildcard If `true`, wildcard and prefix queries are analyzed.This parameter can be used only when the `q` query string parameter isspecified.API name: analyze_wildcard
func (*Explain)Analyzer¶
Analyzer The analyzer to use for the query string.This parameter can be used only when the `q` query string parameter isspecified.API name: analyzer
func (*Explain)DefaultOperator¶
DefaultOperator The default operator for query string query: `AND` or `OR`.This parameter can be used only when the `q` query string parameter isspecified.API name: default_operator
func (*Explain)Df¶
Df The field to use as default where no field prefix is given in the querystring.This parameter can be used only when the `q` query string parameter isspecified.API name: df
func (Explain)Do¶
Do runs the request through the transport, handle the response and returns a explain.Response
func (*Explain)ErrorTrace¶added inv8.14.0
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errorswhen they occur.API name: error_trace
func (*Explain)FilterPath¶added inv8.14.0
FilterPath Comma-separated list of filters in dot notation which reduce the responsereturned by Elasticsearch.API name: filter_path
func (*Explain)HttpRequest¶
HttpRequest returns the http.Request object built from thegiven parameters.
func (*Explain)Human¶added inv8.14.0
Human When set to `true` will return statistics in a format suitable for humans.For example `"exists_time": "1h"` for humans and`"eixsts_time_in_millis": 3600000` for computers. When disabled the humanreadable values will be omitted. This makes sense for responses beingconsumedonly by machines.API name: human
func (*Explain)Lenient¶
Lenient If `true`, format-based query failures (such as providing text to a numericfield) in the query string will be ignored.This parameter can be used only when the `q` query string parameter isspecified.API name: lenient
func (Explain)Perform¶added inv8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Explain)Preference¶
Preference The node or shard the operation should be performed on.It is random by default.API name: preference
func (*Explain)Pretty¶added inv8.14.0
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only usethis option for debugging only.API name: pretty
func (*Explain)Query¶added inv8.9.0
Query Defines the search definition using the Query DSL.API name: query
func (*Explain)Raw¶
Raw takes a json payload as input which is then passed to the http.RequestIf specified Raw takes precedence on Request method.
func (*Explain)Routing¶
Routing A custom value used to route operations to a specific shard.API name: routing
func (*Explain)SourceExcludes_¶
SourceExcludes_ A comma-separated list of source fields to exclude from the response.You can also use this parameter to exclude fields from the subset specifiedin `_source_includes` query parameter.If the `_source` parameter is `false`, this parameter is ignored.API name: _source_excludes
func (*Explain)SourceIncludes_¶
SourceIncludes_ A comma-separated list of source fields to include in the response.If this parameter is specified, only these source fields are returned.You can exclude fields from this subset using the `_source_excludes` queryparameter.If the `_source` parameter is `false`, this parameter is ignored.API name: _source_includes
func (*Explain)Source_¶
Source_ `True` or `false` to return the `_source` field or not or a list of fields toreturn.API name: _source
func (*Explain)StoredFields¶
StoredFields A comma-separated list of stored fields to return in the response.API name: stored_fields
typeNewExplain¶
NewExplain type alias for index.
funcNewExplainFunc¶
func NewExplainFunc(tpelastictransport.Interface)NewExplain
NewExplainFunc returns a new instance of Explain with the provided transport.Used in the index of the library this allows to retrieve every apis in once place.
typeRequest¶
type Request struct {// Query Defines the search definition using the Query DSL.Query *types.Query `json:"query,omitempty"`}Request holds the request body struct for the package explain
typeResponse¶added inv8.7.0
type Response struct {Explanation *types.ExplanationDetail `json:"explanation,omitempty"`Get *types.InlineGet `json:"get,omitempty"`Id_string `json:"_id"`Index_string `json:"_index"`Matchedbool `json:"matched"`}Response holds the response body struct for the package explain