module Elasticsearch::API::Fleet::Actions
Public Instance Methods
Source
# File lib/elasticsearch/api/actions/fleet/global_checkpoints.rb, line 42 def global_checkpoints(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'fleet.global_checkpoints' } defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = "#{Utils.listify(_index)}/_fleet/global_checkpoints" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Get global checkpoints. Get the current global checkpoints for an index. This API
is designed for internal use by the Fleet
server project.
@option arguments [Indexname, Indexalias] :index A single index or index alias that resolves to a single index. (Required) @option arguments [Boolean] :wait_for_advance A boolean value which controls whether to wait (until the timeout) for the global checkpoints
to advance past the provided +checkpoints+.
@option arguments [Boolean] :wait_for_index A boolean value which controls whether to wait (until the timeout) for the target index to exist
and all primary shards be active. Can only be true when +wait_for_advance+ is true.
@option arguments [Array<Integer>] :checkpoints A comma separated list of previous global checkpoints. When used in combination with wait_for_advance
,
the API will only return once the global checkpoints advances past the checkpoints. Providing an empty list will cause Elasticsearch to immediately return the current global checkpoints. Server default: [].
@option arguments [Time] :timeout Period to wait for a global checkpoints to advance past checkpoints
. Server default: 30s. @option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/group/endpoint-fleet
Source
# File lib/elasticsearch/api/actions/fleet/msearch.rb, line 57 def msearch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'fleet.msearch' } defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Utils.listify(_index)}/_fleet/_fleet_msearch" else '_fleet/_fleet_msearch' end params = Utils.process_params(arguments) if body.is_a?(Array) && body.any? { |d| d.key? :search } payload = body.each_with_object([]) do |item, sum| meta = item data = meta.delete(:search) sum << meta sum << data end.map { |item| Elasticsearch::API.serializer.dump(item) } payload << '' unless payload.empty? payload = payload.join("\n") elsif body.is_a?(Array) payload = body.map { |d| d.is_a?(String) ? d : Elasticsearch::API.serializer.dump(d) } payload << '' unless payload.empty? payload = payload.join("\n") else payload = body end headers.merge!({ 'Content-Type' => 'application/vnd.elasticsearch+x-ndjson; compatible-with=9' }) Elasticsearch::API::Response.new( perform_request(method, path, params, payload, headers, request_opts) ) end
Run multiple Fleet
searches. Run several Fleet
searches with a single API
request. The API
follows the same structure as the multi search API
. However, similar to the Fleet
search API
, it supports the wait_for_checkpoints
parameter. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.
@option arguments [Indexname, Indexalias] :index A single target to search. If the target is an index alias, it must resolve to a single index. @option arguments [Boolean] :allow_no_indices 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. @option arguments [Boolean] :ccs_minimize_roundtrips If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. Server default: true. @option arguments [String, Array<String>] :expand_wildcards 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. @option arguments [Boolean] :ignore_throttled If true, concrete, expanded or aliased indices are ignored when frozen. @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. @option arguments [Integer] :max_concurrent_searches Maximum number of concurrent searches the multi search API
can execute. @option arguments [Integer] :max_concurrent_shard_requests Maximum number of concurrent shard requests that each sub-search request executes per node. Server default: 5. @option arguments [Integer] :pre_filter_shard_size 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. @option arguments [String] :search_type Indicates whether global term and document frequencies should be used when scoring returned documents. @option arguments [Boolean] :rest_total_hits_as_int If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. @option arguments [Boolean] :typed_keys Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. @option arguments [Array<Integer>] :wait_for_checkpoints 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. Server default: [].
@option arguments [Boolean] :allow_partial_search_results If true, returns partial results if there are shard request timeouts or 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.
@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body searches
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-fleet-msearch
Source
# File lib/elasticsearch/api/actions/fleet/search.rb, line 86 def search(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'fleet.search' } defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = "#{Utils.listify(_index)}/_fleet/_fleet_search" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Run a Fleet
search. The purpose of the Fleet
search API
is to provide an API
where the search will be run only after the provided checkpoint has been processed and is visible for searches inside of Elasticsearch
. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.
@option arguments [Indexname, Indexalias] :index A single target to search. If the target is an index alias, it must resolve to a single index. (Required) @option arguments [Boolean] :allow_no_indices [TODO] @option arguments [String] :analyzer [TODO] @option arguments [Boolean] :analyze_wildcard [TODO] @option arguments [Integer] :batched_reduce_size [TODO] @option arguments [Boolean] :ccs_minimize_roundtrips [TODO] @option arguments [String] :default_operator [TODO] @option arguments [String] :df [TODO] @option arguments [String, Array<String>] :docvalue_fields [TODO] @option arguments [String, Array<String>] :expand_wildcards [TODO] @option arguments [Boolean] :explain [TODO] @option arguments [Boolean] :ignore_throttled [TODO] @option arguments [Boolean] :ignore_unavailable [TODO] @option arguments [Boolean] :lenient [TODO] @option arguments [Integer] :max_concurrent_shard_requests [TODO] @option arguments [String] :preference [TODO] @option arguments [Integer] :pre_filter_shard_size [TODO] @option arguments [Boolean] :request_cache [TODO] @option arguments [String] :routing [TODO] @option arguments [Time] :scroll [TODO] @option arguments [String] :search_type [TODO] @option arguments [Array<String>] :stats [TODO] @option arguments [String, Array<String>] :stored_fields [TODO] @option arguments [String] :suggest_field Specifies which field to use for suggestions. @option arguments [String] :suggest_mode [TODO] @option arguments [Integer] :suggest_size [TODO] @option arguments [String] :suggest_text The source text for which the suggestions should be returned. @option arguments [Integer] :terminate_after [TODO] @option arguments [Time] :timeout [TODO] @option arguments [Boolean, Integer] :track_total_hits [TODO] @option arguments [Boolean] :track_scores [TODO] @option arguments [Boolean] :typed_keys [TODO] @option arguments [Boolean] :rest_total_hits_as_int [TODO] @option arguments [Boolean] :version [TODO] @option arguments [Boolean, String, Array<String>] :_source [TODO] @option arguments [String, Array<String>] :_source_excludes [TODO] @option arguments [String, Array<String>] :_source_includes [TODO] @option arguments [Boolean] :seq_no_primary_term [TODO] @option arguments [String] :q [TODO] @option arguments [Integer] :size [TODO] @option arguments [Integer] :from [TODO] @option arguments [String] :sort [TODO] @option arguments [Array<Integer>] :wait_for_checkpoints 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. Server default: [].
@option arguments [Boolean] :allow_partial_search_results If true, returns partial results if there are shard request timeouts or 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.
@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body request body
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-fleet-search