msearchtemplate

package
v8.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Allows to execute several search template operations in one request.

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

type MsearchTemplate

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

func New

Allows to execute several search template operations in one request.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html

func (*MsearchTemplate) CcsMinimizeRoundtrips

func (r *MsearchTemplate) CcsMinimizeRoundtrips(ccsminimizeroundtrips bool) *MsearchTemplate

CcsMinimizeRoundtrips If `true`, network round-trips are minimized for cross-cluster search requests. API name: ccs_minimize_roundtrips

func (MsearchTemplate) Do

func (r MsearchTemplate) Do(providedCtx context.Context) (*Response, error)

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

func (*MsearchTemplate) Header

func (r *MsearchTemplate) Header(key, value string) *MsearchTemplate

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

func (*MsearchTemplate) HttpRequest

func (r *MsearchTemplate) HttpRequest(ctx context.Context) (*http.Request, error)

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

func (*MsearchTemplate) Index

func (r *MsearchTemplate) Index(index string) *MsearchTemplate

Index Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (`*`). To search all data streams and indices, omit this parameter or use `*`. API Name: index

func (*MsearchTemplate) MaxConcurrentSearches

func (r *MsearchTemplate) MaxConcurrentSearches(maxconcurrentsearches string) *MsearchTemplate

MaxConcurrentSearches Maximum number of concurrent searches the API can run. API name: max_concurrent_searches

func (MsearchTemplate) Perform

func (r MsearchTemplate) Perform(providedCtx context.Context) (*http.Response, error)

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

func (*MsearchTemplate) 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 (*MsearchTemplate) Request

func (r *MsearchTemplate) Request(req *Request) *MsearchTemplate

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

func (*MsearchTemplate) RestTotalHitsAsInt

func (r *MsearchTemplate) RestTotalHitsAsInt(resttotalhitsasint bool) *MsearchTemplate

RestTotalHitsAsInt If `true`, the response returns `hits.total` as an integer. If `false`, it returns `hits.total` as an object. API name: rest_total_hits_as_int

func (*MsearchTemplate) SearchType

func (r *MsearchTemplate) SearchType(searchtype searchtype.SearchType) *MsearchTemplate

SearchType The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. API name: search_type

func (*MsearchTemplate) TypedKeys

func (r *MsearchTemplate) TypedKeys(typedkeys bool) *MsearchTemplate

TypedKeys If `true`, the response prefixes aggregation and suggester names with their respective types. API name: typed_keys

type NewMsearchTemplate

type NewMsearchTemplate func() *MsearchTemplate

NewMsearchTemplate type alias for index.

func NewMsearchTemplateFunc

func NewMsearchTemplateFunc(tp elastictransport.Interface) NewMsearchTemplate

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

type Response

type Response struct {
	Responses []types.MsearchResponseItem `json:"responses"`
	Took      int64                       `json:"took"`
}

Response holds the response body struct for the package msearchtemplate

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/_global/msearch_template/MultiSearchTemplateResponse.ts#L22-L24

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

func (*Response) UnmarshalJSON added in v8.12.0

func (s *Response) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL