Movatterモバイル変換


[0]ホーム

URL:


Notice  The highest tagged major version isv9.

explain

package
v8.19.1Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License:Apache-2.0Imports:13Imported by:4

Details

Repository

github.com/elastic/go-elasticsearch

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

Constants

This section is empty.

Variables

View Source
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

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

func (r *Explain) AnalyzeWildcard(analyzewildcardbool) *Explain

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

func (r *Explain) Analyzer(analyzerstring) *Explain

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

func (r *Explain) DefaultOperator(defaultoperatoroperator.Operator) *Explain

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

func (r *Explain) Df(dfstring) *Explain

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

func (rExplain) Do(providedCtxcontext.Context) (*Response,error)

Do runs the request through the transport, handle the response and returns a explain.Response

func (*Explain)ErrorTraceadded inv8.14.0

func (r *Explain) ErrorTrace(errortracebool) *Explain

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errorswhen they occur.API name: error_trace

func (*Explain)FilterPathadded inv8.14.0

func (r *Explain) FilterPath(filterpaths ...string) *Explain

FilterPath Comma-separated list of filters in dot notation which reduce the responsereturned by Elasticsearch.API name: filter_path

func (*Explain)Header

func (r *Explain) Header(key, valuestring) *Explain

Header set a key, value pair in the Explain headers map.

func (*Explain)HttpRequest

func (r *Explain) HttpRequest(ctxcontext.Context) (*http.Request,error)

HttpRequest returns the http.Request object built from thegiven parameters.

func (*Explain)Humanadded inv8.14.0

func (r *Explain) Human(humanbool) *Explain

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

func (r *Explain) Lenient(lenientbool) *Explain

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)Performadded inv8.7.0

func (rExplain) Perform(providedCtxcontext.Context) (*http.Response,error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*Explain)Preference

func (r *Explain) Preference(preferencestring) *Explain

Preference The node or shard the operation should be performed on.It is random by default.API name: preference

func (*Explain)Prettyadded inv8.14.0

func (r *Explain) Pretty(prettybool) *Explain

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only usethis option for debugging only.API name: pretty

func (*Explain)Q

func (r *Explain) Q(qstring) *Explain

Q The query in the Lucene query string syntax.API name: q

func (*Explain)Queryadded inv8.9.0

func (r *Explain) Query(query *types.Query) *Explain

Query Defines the search definition using the Query DSL.API name: query

func (*Explain)Raw

func (r *Explain) Raw(rawio.Reader) *Explain

Raw takes a json payload as input which is then passed to the http.RequestIf specified Raw takes precedence on Request method.

func (*Explain)Request

func (r *Explain) Request(req *Request) *Explain

Request allows to set the request property with the appropriate payload.

func (*Explain)Routing

func (r *Explain) Routing(routingstring) *Explain

Routing A custom value used to route operations to a specific shard.API name: routing

func (*Explain)SourceExcludes_

func (r *Explain) SourceExcludes_(fields ...string) *Explain

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_

func (r *Explain) SourceIncludes_(fields ...string) *Explain

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_

func (r *Explain) Source_(sourceconfigparamstring) *Explain

Source_ `True` or `false` to return the `_source` field or not or a list of fields toreturn.API name: _source

func (*Explain)StoredFields

func (r *Explain) StoredFields(fields ...string) *Explain

StoredFields A comma-separated list of stored fields to return in the response.API name: stored_fields

typeNewExplain

type NewExplain func(index, idstring) *Explain

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

https://github.com/elastic/elasticsearch-specification/blob/470b4b9aaaa25cae633ec690e54b725c6fc939c7/specification/_global/explain/ExplainRequest.ts#L26-L125

funcNewRequestadded inv8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request)FromJSONadded inv8.5.0

func (r *Request) FromJSON(datastring) (*Request,error)

FromJSON allows to load an arbitrary json into the request structure

typeResponseadded 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

https://github.com/elastic/elasticsearch-specification/blob/470b4b9aaaa25cae633ec690e54b725c6fc939c7/specification/_global/explain/ExplainResponse.ts#L23-L31

funcNewResponseadded inv8.7.0

func NewResponse() *Response

NewResponse returns a Response

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp