Movatterモバイル変換


[0]ホーム

URL:


Notice  The highest tagged major version isv9.

test

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:12Imported by:0

Details

Repository

github.com/elastic/go-elasticsearch

Links

Documentation

Overview

Test a query ruleset.Evaluate match criteria against a query ruleset to identify the rules thatwould match that criteria.

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

typeNewTest

type NewTest func(rulesetidstring) *Test

NewTest type alias for index.

funcNewTestFunc

NewTestFunc returns a new instance of Test with the provided transport.Used in the index of the library this allows to retrieve every apis in once place.

typeRequest

type Request struct {// MatchCriteria The match criteria to apply to rules in the given query ruleset.// Match criteria should match the keys defined in the `criteria.metadata` field// of the rule.MatchCriteria map[string]json.RawMessage `json:"match_criteria"`}

Request holds the request body struct for the package test

https://github.com/elastic/elasticsearch-specification/blob/470b4b9aaaa25cae633ec690e54b725c6fc939c7/specification/query_rules/test/QueryRulesetTestRequest.ts#L24-L57

funcNewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request)FromJSON

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

FromJSON allows to load an arbitrary json into the request structure

typeResponse

type Response struct {MatchedRules      []types.QueryRulesetMatchedRule `json:"matched_rules"`TotalMatchedRulesint                             `json:"total_matched_rules"`}

Response holds the response body struct for the package test

https://github.com/elastic/elasticsearch-specification/blob/470b4b9aaaa25cae633ec690e54b725c6fc939c7/specification/query_rules/test/QueryRulesetTestResponse.ts#L23-L28

funcNewResponse

func NewResponse() *Response

NewResponse returns a Response

typeTest

type Test struct {// contains filtered or unexported fields}

funcNew

Test a query ruleset.Evaluate match criteria against a query ruleset to identify the rules thatwould match that criteria.

https://www.elastic.co/guide/en/elasticsearch/reference/current/test-query-ruleset.html

func (Test)Do

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

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

func (*Test)ErrorTrace

func (r *Test) ErrorTrace(errortracebool) *Test

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

func (*Test)FilterPath

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

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

func (*Test)Header

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

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

func (*Test)HttpRequest

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

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

func (*Test)Human

func (r *Test) Human(humanbool) *Test

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 (*Test)MatchCriteria

func (r *Test) MatchCriteria(matchcriteria map[string]json.RawMessage) *Test

MatchCriteria The match criteria to apply to rules in the given query ruleset.Match criteria should match the keys defined in the `criteria.metadata` fieldof the rule.API name: match_criteria

func (Test)Perform

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

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

func (*Test)Pretty

func (r *Test) Pretty(prettybool) *Test

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

func (*Test)Raw

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

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

func (*Test)Request

func (r *Test) Request(req *Request) *Test

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

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