elasticxsearch

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*search.Search)

func AllowNoIndices

func AllowNoIndices(b bool) Option

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 AllowPartialSearchResults

func AllowPartialSearchResults(b bool) Option

AllowPartialSearchResults If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. API name: allow_partial_search_results

func AnalyzeWildcard

func AnalyzeWildcard(b bool) Option

AnalyzeWildcard If true, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified. API name: analyze_wildcard

func Analyzer

func Analyzer(a string) Option

Analyzer Analyzer to use for the query string. This parameter can only be used when the q query string parameter is specified. API name: analyzer

func BatchedReduceSize

func BatchedReduceSize(b string) Option

BatchedReduceSize The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. API name: batched_reduce_size

func CcsMinimizeRoundtrips

func CcsMinimizeRoundtrips(b bool) Option

CcsMinimizeRoundtrips If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. API name: ccs_minimize_roundtrips

func DefaultOperator

func DefaultOperator(d operator.Operator) Option

DefaultOperator The default operator for query string query: AND or OR. This parameter can only be used when the `q` query string parameter is specified. API name: default_operator

func Df

func Df(d string) Option

Df Field to use as default where no field prefix is given in the query string. This parameter can only be used when the q query string parameter is specified. API name: df

func ErrorTrace

func ErrorTrace(b bool) Option

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

func ExpandWildcards

func ExpandWildcards(expandwildcards ...expandwildcard.ExpandWildcard) Option

ExpandWildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. API name: expand_wildcards

func FilterPath

func FilterPath(filterpath ...string) Option

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

func ForceSyntheticSource

func ForceSyntheticSource(b bool) Option

ForceSyntheticSource Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index. API name: force_synthetic_source

func Human

func Human(b bool) Option

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 human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func IgnoreThrottled

func IgnoreThrottled(b bool) Option

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

func IgnoreUnavailable

func IgnoreUnavailable(b bool) Option

IgnoreUnavailable If `false`, the request returns an error if it targets a missing or closed index. API name: ignore_unavailable

func Lenient

func Lenient(b bool) Option

Lenient If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can only be used when the `q` query string parameter is specified. API name: lenient

func MaxConcurrentShardRequests

func MaxConcurrentShardRequests(m string) Option

MaxConcurrentShardRequests Defines the number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. API name: max_concurrent_shard_requests

func MinCompatibleShardNode

func MinCompatibleShardNode(m string) Option

MinCompatibleShardNode The minimum version of the node that can handle the request Any handling node with a lower version will fail the request. API name: min_compatible_shard_node

func PreFilterShardSize

func PreFilterShardSize(p string) Option

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 (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met: the request targets more than 128 shards; the request targets one or more read-only index; the primary sort of the query targets an indexed field. API name: pre_filter_shard_size

func Preference

func Preference(p string) Option

Preference Nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: `_only_local` to run the search only on shards on the local node; `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method; `_only_nodes:<node-id>,<node-id>` to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method; `_prefer_nodes:<node-id>,<node-id>` to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method; `_shards:<shard>,<shard>` to run the search only on the specified shards; `<custom-string>` (any string that does not start with `_`) to route searches with the same `<custom-string>` to the same shards in the same order. API name: preference

func Pretty

func Pretty(b bool) Option

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

func Q

func Q(q string) Option

Q Query in the Lucene query string syntax using query parameter search. Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing. API name: q

func RequestCache

func RequestCache(b bool) Option

RequestCache If `true`, the caching of search results is enabled for requests where `size` is `0`. Defaults to index level settings. API name: request_cache

func RestTotalHitsAsInt

func RestTotalHitsAsInt(b bool) Option

RestTotalHitsAsInt Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. API name: rest_total_hits_as_int

func Routing

func Routing(r string) Option

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

func Scroll

func Scroll(duration string) Option

Scroll Period to retain the search context for scrolling. See Scroll search results. By default, this value cannot exceed `1d` (24 hours). You can change this limit using the `search.max_keep_alive` cluster-level setting. API name: scroll

func SearchType

func SearchType(searchtype searchtype.SearchType) Option

SearchType How distributed term frequencies are calculated for relevance scoring. API name: search_type

func SourceExcludes_

func SourceExcludes_(sourceexcludes ...string) Option

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 specified in `_source_includes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. API name: _source_excludes

func SourceIncludes_

func SourceIncludes_(sourceincludes ...string) Option

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` query parameter. If the `_source` parameter is `false`, this parameter is ignored. API name: _source_includes

func SuggestField

func SuggestField(field string) Option

SuggestField Specifies which field to use for suggestions. API name: suggest_field

func SuggestMode

func SuggestMode(suggestmode suggestmode.SuggestMode) Option

SuggestMode Specifies the suggest mode. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified. API name: suggest_mode

func SuggestSize

func SuggestSize(suggestsize string) Option

SuggestSize Number of suggestions to return. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified. API name: suggest_size

func SuggestText

func SuggestText(suggesttext string) Option

SuggestText The source text for which the suggestions should be returned. This parameter can only be used when the `suggest_field` and `suggest_text` query string parameters are specified. API name: suggest_text

func TypedKeys

func TypedKeys(typedkeys bool) Option

TypedKeys If `true`, aggregation and suggester names are be prefixed by their respective types in the response. API name: typed_keys

Jump to

Keyboard shortcuts

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