msearch

package
v8.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Overview

Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project.

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 Msearch

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

func New

Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project.

func (*Msearch) AllowNoIndices

func (r *Msearch) AllowNoIndices(allownoindices bool) *Msearch

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 (*Msearch) AllowPartialSearchResults

func (r *Msearch) AllowPartialSearchResults(allowpartialsearchresults bool) *Msearch

AllowPartialSearchResults If true, returns partial results if there are shard request timeouts or [shard failures](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-replication.html#shard-failures). If false, returns an error with no partial results. Defaults to the configured cluster setting `search.default_allow_partial_results` which is true by default. API name: allow_partial_search_results

func (*Msearch) CcsMinimizeRoundtrips

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

CcsMinimizeRoundtrips If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. API name: ccs_minimize_roundtrips

func (Msearch) Do

func (r Msearch) Do(ctx context.Context) (*Response, error)

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

func (*Msearch) ExpandWildcards

func (r *Msearch) ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) *Msearch

ExpandWildcards Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. API name: expand_wildcards

func (*Msearch) Header

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

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

func (*Msearch) HttpRequest

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

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

func (*Msearch) IgnoreThrottled

func (r *Msearch) IgnoreThrottled(ignorethrottled bool) *Msearch

IgnoreThrottled If true, concrete, expanded or aliased indices are ignored when frozen. API name: ignore_throttled

func (*Msearch) IgnoreUnavailable

func (r *Msearch) IgnoreUnavailable(ignoreunavailable bool) *Msearch

IgnoreUnavailable If true, missing or closed indices are not included in the response. API name: ignore_unavailable

func (*Msearch) Index

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

Index A single target to search. If the target is an index alias, it must resolve to a single index. API Name: index

func (*Msearch) MaxConcurrentSearches

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

MaxConcurrentSearches Maximum number of concurrent searches the multi search API can execute. API name: max_concurrent_searches

func (*Msearch) MaxConcurrentShardRequests

func (r *Msearch) MaxConcurrentShardRequests(maxconcurrentshardrequests string) *Msearch

MaxConcurrentShardRequests Maximum number of concurrent shard requests that each sub-search request executes per node. API name: max_concurrent_shard_requests

func (Msearch) Perform

func (r Msearch) Perform(ctx context.Context) (*http.Response, error)

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

func (*Msearch) PreFilterShardSize

func (r *Msearch) PreFilterShardSize(prefiltershardsize string) *Msearch

PreFilterShardSize Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. API name: pre_filter_shard_size

func (*Msearch) Raw

func (r *Msearch) Raw(raw io.Reader) *Msearch

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

func (*Msearch) Request

func (r *Msearch) Request(req *Request) *Msearch

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

func (*Msearch) RestTotalHitsAsInt

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

RestTotalHitsAsInt If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. API name: rest_total_hits_as_int

func (*Msearch) SearchType

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

SearchType Indicates whether global term and document frequencies should be used when scoring returned documents. API name: search_type

func (*Msearch) TypedKeys

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

TypedKeys Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. API name: typed_keys

func (*Msearch) WaitForCheckpoints

func (r *Msearch) WaitForCheckpoints(waitforcheckpoints ...int64) *Msearch

WaitForCheckpoints A comma separated list of checkpoints. When configured, the search API will only be executed on a shard after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause Elasticsearch to immediately execute the search. API name: wait_for_checkpoints

type NewMsearch

type NewMsearch func() *Msearch

NewMsearch type alias for index.

func NewMsearchFunc

func NewMsearchFunc(tp elastictransport.Interface) NewMsearch

NewMsearchFunc returns a new instance of Msearch 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 {
	Docs []types.MsearchResponseItem `json:"docs"`
}

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

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