From 516da3a7202d9f9bb5e6398f5269e467ce33403b Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Fri, 1 Sep 2023 02:17:50 +0930 Subject: [PATCH 1/6] Auto-generated code for main (#1996) --- docs/reference.asciidoc | 2 ++ src/api/api/indices.ts | 2 +- src/api/types.ts | 12 ++++++++++++ src/api/typesWithBodyKey.ts | 12 ++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 1619d7f58..072395dbe 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -4016,6 +4016,8 @@ To target all data streams use `*` or `_all`. ** *`data_retention` (Optional, string | -1 | 0)*: If defined, every document added to this data stream will be stored at least for this time frame. Any time after this duration the document could be deleted. When empty, every document in this data stream will be stored indefinitely. +** *`downsampling` (Optional, { rounds })*: If defined, every backing index will execute the configured downsampling configuration after the backing +index is not the data stream write index anymore. ** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of data stream that wildcard patterns can match. Supports a list of values, such as `open,hidden`. Valid values are: `all`, `hidden`, `open`, `closed`, `none`. diff --git a/src/api/api/indices.ts b/src/api/api/indices.ts index 2dcf18270..078b1c52d 100644 --- a/src/api/api/indices.ts +++ b/src/api/api/indices.ts @@ -1233,7 +1233,7 @@ export default class Indices { async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise async putDataLifecycle (this: That, params: T.IndicesPutDataLifecycleRequest | TB.IndicesPutDataLifecycleRequest, options?: TransportRequestOptions): Promise { const acceptedPath: string[] = ['name'] - const acceptedBody: string[] = ['data_retention'] + const acceptedBody: string[] = ['data_retention', 'downsampling'] const querystring: Record = {} // @ts-expect-error const userBody: any = params?.body diff --git a/src/api/types.ts b/src/api/types.ts index 384ca440a..242ee9f69 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -9519,6 +9519,11 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling +} + +export interface IndicesDataStreamLifecycleDownsampling { + rounds: IndicesDownsamplingRound[] } export interface IndicesDataStreamLifecycleRolloverConditions { @@ -9536,6 +9541,7 @@ export interface IndicesDataStreamLifecycleRolloverConditions { export interface IndicesDataStreamLifecycleWithRollover { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling rollover?: IndicesDataStreamLifecycleRolloverConditions } @@ -9551,6 +9557,11 @@ export interface IndicesDownsampleConfig { fixed_interval: DurationLarge } +export interface IndicesDownsamplingRound { + after: Duration + config: IndicesDownsampleConfig +} + export interface IndicesFielddataFrequencyFilter { max: double min: double @@ -10537,6 +10548,7 @@ export interface IndicesPutDataLifecycleRequest extends RequestBase { master_timeout?: Duration timeout?: Duration data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } export type IndicesPutDataLifecycleResponse = AcknowledgedResponseBase diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 94861b37d..2401a1d6d 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -9642,6 +9642,11 @@ export interface IndicesDataStreamIndex { export interface IndicesDataStreamLifecycle { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling +} + +export interface IndicesDataStreamLifecycleDownsampling { + rounds: IndicesDownsamplingRound[] } export interface IndicesDataStreamLifecycleRolloverConditions { @@ -9659,6 +9664,7 @@ export interface IndicesDataStreamLifecycleRolloverConditions { export interface IndicesDataStreamLifecycleWithRollover { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling rollover?: IndicesDataStreamLifecycleRolloverConditions } @@ -9674,6 +9680,11 @@ export interface IndicesDownsampleConfig { fixed_interval: DurationLarge } +export interface IndicesDownsamplingRound { + after: Duration + config: IndicesDownsampleConfig +} + export interface IndicesFielddataFrequencyFilter { max: double min: double @@ -10678,6 +10689,7 @@ export interface IndicesPutDataLifecycleRequest extends RequestBase { /** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */ body?: { data_retention?: Duration + downsampling?: IndicesDataStreamLifecycleDownsampling } } From a4be77425eee057de771b24d2272bd69c1fae62c Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 31 Aug 2023 21:24:36 +0400 Subject: [PATCH 2/6] Use GitHub admonition for browser support warning (#1997) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9281aefc8..37e78a387 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,8 @@ npm install @elastic/elasticsearch@ #### Browser -WARNING: There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues. +> [!WARNING] +> There is no official support for the browser environment. It exposes your Elasticsearch instance to everyone, which could lead to security issues. We recommend that you write a lightweight proxy that uses this client instead, you can see a proxy example [here](./docs/examples/proxy). ## Documentation From 63b4b4c08a35109df3fd12c54783fe2875becd98 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Wed, 6 Sep 2023 03:58:51 +0930 Subject: [PATCH 3/6] Auto-generated code for main (#1998) --- docs/reference.asciidoc | 103 +++++++++++++++++++++--------------- src/api/types.ts | 17 ++++++ src/api/typesWithBodyKey.ts | 17 ++++++ 3 files changed, 93 insertions(+), 44 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 072395dbe..1ddd6e5f7 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -93,22 +93,34 @@ client.count({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: A list of indices to restrict the results -** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })* -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`analyzer` (Optional, string)*: The analyzer to use for the query string -** *`analyze_wildcard` (Optional, boolean)*: Specify whether wildcard and prefix queries should be analyzed (default: false) -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query (AND or OR) -** *`df` (Optional, string)*: The field to use as default where no field prefix is given in the query string -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_throttled` (Optional, boolean)*: Whether specified concrete, expanded or aliased indices should be ignored when throttled -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -** *`min_score` (Optional, number)*: Include only documents with a specific `_score` value in the result -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`routing` (Optional, string)*: A list of specific routing values -** *`terminate_after` (Optional, number)*: The maximum count for each shard, upon reaching which the query execution will terminate early -** *`q` (Optional, string)*: Query in the Lucene query string syntax +** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams and indices, omit this parameter or use `*` or `_all`. +** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`allow_no_indices` (Optional, boolean)*: 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. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +This parameter can only be used when the `q` query string parameter is specified. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +This parameter can only be used when the `q` query string parameter is specified. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +This parameter can only be used when the `q` query string parameter is specified. +** *`df` (Optional, string)*: 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. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: 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 a list of values, such as `open,hidden`. +** *`ignore_throttled` (Optional, boolean)*: If `true`, concrete, expanded or aliased indices are ignored when frozen. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`min_score` (Optional, number)*: Sets the minimum `_score` value that documents must have to be included in the result. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`terminate_after` (Optional, number)*: Maximum number of documents to collect for each shard. +If a query reaches this limit, Elasticsearch terminates the query early. +Elasticsearch collects documents before sorting. +** *`q` (Optional, string)*: Query in the Lucene query string syntax. [discrete] === create @@ -7156,9 +7168,9 @@ client.searchApplication.list({ ... }) ==== Arguments * *Request (object):* -** *`q` (Optional, string)*: Query in the Lucene query string syntax" -** *`from` (Optional, number)*: Starting offset (default: 0) -** *`size` (Optional, number)*: specifies a max number of results to get +** *`q` (Optional, string)*: Query in the Lucene query string syntax. +** *`from` (Optional, number)*: Starting offset. +** *`size` (Optional, number)*: Specifies a max number of results to get. [discrete] ==== post_behavioral_analytics_event @@ -7185,9 +7197,9 @@ client.searchApplication.put({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the search application to be created or updated +** *`name` (string)*: The name of the search application to be created or updated. ** *`search_application` (Optional, { name, indices, updated_at_millis, analytics_collection_name, template })* -** *`create` (Optional, boolean)*: If true, requires that a search application with the specified resource_id does not already exist. (default: false) +** *`create` (Optional, boolean)*: If `true`, this request cannot replace or update existing Search Applications. [discrete] ==== put_behavioral_analytics @@ -7203,7 +7215,7 @@ client.searchApplication.putBehavioralAnalytics({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the analytics collection to be created or updated +** *`name` (string)*: The name of the analytics collection to be created or updated. [discrete] ==== render_query @@ -7230,8 +7242,8 @@ client.searchApplication.search({ name }) ==== Arguments * *Request (object):* -** *`name` (string)*: The name of the search application to be searched -** *`params` (Optional, Record)* +** *`name` (string)*: The name of the search application to be searched. +** *`params` (Optional, Record)*: Query parameters specific to this request, which will override any defaults specified in the template. [discrete] === searchable_snapshots @@ -8575,7 +8587,7 @@ client.sql.clearCursor({ cursor }) ==== Arguments * *Request (object):* -** *`cursor` (string)* +** *`cursor` (string)*: Cursor to clear. [discrete] ==== delete_async @@ -8591,7 +8603,7 @@ client.sql.deleteAsync({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: The async search ID +** *`id` (string)*: Identifier for the search. [discrete] ==== get_async @@ -8607,7 +8619,7 @@ client.sql.getAsync({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: The async search ID +** *`id` (string)*: Identifier for the search. ** *`delimiter` (Optional, string)*: Separator for CSV results. The API only supports this parameter for CSV responses. ** *`format` (Optional, string)*: Format for the response. You must specify a format using this parameter or the Accept HTTP header. If you specify both, the API uses this parameter. @@ -8630,7 +8642,7 @@ client.sql.getAsyncStatus({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: The async search ID +** *`id` (string)*: Identifier for the search. [discrete] ==== query @@ -8648,13 +8660,15 @@ client.sql.query({ ... }) * *Request (object):* ** *`catalog` (Optional, string)*: Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only. ** *`columnar` (Optional, boolean)*: If true, the results in a columnar fashion: one row represents all the values of a certain column from the current page of results. -** *`cursor` (Optional, string)* +** *`cursor` (Optional, string)*: Cursor used to retrieve a set of paginated results. +If you specify a cursor, the API only uses the `columnar` and `time_zone` request body parameters. +It ignores other request body parameters. ** *`fetch_size` (Optional, number)*: The maximum number of rows (or entries) to return in one response -** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })*: Optional Elasticsearch query DSL for additional filtering. -** *`query` (Optional, string)*: SQL query to execute +** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })*: Elasticsearch query DSL for additional filtering. +** *`query` (Optional, string)*: SQL query to run. ** *`request_timeout` (Optional, string | -1 | 0)*: The timeout before the request fails. ** *`page_timeout` (Optional, string | -1 | 0)*: The timeout before a pagination request fails. -** *`time_zone` (Optional, string)*: Time-zone in ISO 8601 used for executing the query on the server. More information available here. +** *`time_zone` (Optional, string)*: ISO-8601 time zone ID for the search. ** *`field_multi_value_leniency` (Optional, boolean)*: Throw an exception when encountering multiple values for a field (default) or be lenient and return the first value from the list (without any guarantees of what that will be - typically the first in natural ascending order). ** *`runtime_mappings` (Optional, Record)*: Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name. @@ -8663,7 +8677,7 @@ precedence over mapped fields with the same name. ** *`keep_alive` (Optional, string | -1 | 0)*: Retention period for an async or saved synchronous search. ** *`keep_on_completion` (Optional, boolean)*: If true, Elasticsearch stores synchronous searches if you also specify the wait_for_completion_timeout parameter. If false, Elasticsearch only stores async searches that don’t finish before the wait_for_completion_timeout. ** *`index_using_frozen` (Optional, boolean)*: If true, the search can run on frozen indices. Defaults to false. -** *`format` (Optional, string)*: a short version of the Accept header, e.g. json, yaml +** *`format` (Optional, string)*: Format for the response. [discrete] ==== translate @@ -8679,10 +8693,10 @@ client.sql.translate({ query }) ==== Arguments * *Request (object):* -** *`query` (string)* -** *`fetch_size` (Optional, number)* -** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })* -** *`time_zone` (Optional, string)* +** *`query` (string)*: SQL query to run. +** *`fetch_size` (Optional, number)*: The maximum number of rows (or entries) to return in one response. +** *`filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })*: Elasticsearch query DSL for additional filtering. +** *`time_zone` (Optional, string)*: ISO-8601 time zone ID for the search. [discrete] === ssl @@ -8835,10 +8849,10 @@ client.tasks.cancel({ ... }) ==== Arguments * *Request (object):* -** *`task_id` (Optional, string | number)*: Cancel the task with specified task id (node_id:task_number) -** *`actions` (Optional, string | string[])*: A list of actions that should be cancelled. Leave empty to cancel all. -** *`nodes` (Optional, string[])*: A list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes -** *`parent_task_id` (Optional, string)*: Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. +** *`task_id` (Optional, string | number)*: ID of the task. +** *`actions` (Optional, string | string[])*: List or wildcard expression of actions used to limit the request. +** *`nodes` (Optional, string[])*: List of node IDs or names used to limit the request. +** *`parent_task_id` (Optional, string)*: Parent task ID used to limit the tasks. ** *`wait_for_completion` (Optional, boolean)*: Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false [discrete] @@ -8855,9 +8869,10 @@ client.tasks.get({ task_id }) ==== Arguments * *Request (object):* -** *`task_id` (string)*: Return the task with specified id (node_id:task_number) -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`wait_for_completion` (Optional, boolean)*: Wait for the matching tasks to complete (default: false) +** *`task_id` (string)*: ID of the task. +** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. +If no response is received before the timeout expires, the request fails and returns an error. +** *`wait_for_completion` (Optional, boolean)*: If `true`, the request blocks until the task has completed. [discrete] ==== list diff --git a/src/api/types.ts b/src/api/types.ts index 242ee9f69..cb43fd81e 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -1988,14 +1988,28 @@ export type Bytes = 'b' | 'kb' | 'mb' | 'gb' | 'tb' | 'pb' export type CategoryId = string +export type ClusterAlias = string + +export interface ClusterDetails { + status: ClusterSearchStatus + indices: string + took?: DurationValue + timed_out: boolean + _shards?: ShardStatistics + failures?: ShardFailure[] +} + export type ClusterInfoTarget = '_all' | 'http' | 'ingest' | 'thread_pool' | 'script' export type ClusterInfoTargets = ClusterInfoTarget | ClusterInfoTarget[] +export type ClusterSearchStatus = 'running' | 'successful' | 'partial' | 'skipped' | 'failed' + export interface ClusterStatistics { skipped: integer successful: integer total: integer + details?: Record } export interface CompletionStats { @@ -6033,6 +6047,8 @@ export interface AsyncSearchAsyncSearchResponseBase { expiration_time_in_millis: EpochTime start_time?: DateTime start_time_in_millis: EpochTime + completion_time?: DateTime + completion_time_in_millis?: EpochTime } export interface AsyncSearchDeleteRequest extends RequestBase { @@ -6058,6 +6074,7 @@ export type AsyncSearchStatusResponse = AsyncSearchStatusStatusResponseBase export interface AsyncSearchStatusStatusResponseBase extends AsyncSearchAsyncSearchResponseBase { _shards: ShardStatistics + _clusters?: ClusterStatistics completion_status?: integer } diff --git a/src/api/typesWithBodyKey.ts b/src/api/typesWithBodyKey.ts index 2401a1d6d..c97c43834 100644 --- a/src/api/typesWithBodyKey.ts +++ b/src/api/typesWithBodyKey.ts @@ -2061,14 +2061,28 @@ export type Bytes = 'b' | 'kb' | 'mb' | 'gb' | 'tb' | 'pb' export type CategoryId = string +export type ClusterAlias = string + +export interface ClusterDetails { + status: ClusterSearchStatus + indices: string + took?: DurationValue + timed_out: boolean + _shards?: ShardStatistics + failures?: ShardFailure[] +} + export type ClusterInfoTarget = '_all' | 'http' | 'ingest' | 'thread_pool' | 'script' export type ClusterInfoTargets = ClusterInfoTarget | ClusterInfoTarget[] +export type ClusterSearchStatus = 'running' | 'successful' | 'partial' | 'skipped' | 'failed' + export interface ClusterStatistics { skipped: integer successful: integer total: integer + details?: Record } export interface CompletionStats { @@ -6106,6 +6120,8 @@ export interface AsyncSearchAsyncSearchResponseBase { expiration_time_in_millis: EpochTime start_time?: DateTime start_time_in_millis: EpochTime + completion_time?: DateTime + completion_time_in_millis?: EpochTime } export interface AsyncSearchDeleteRequest extends RequestBase { @@ -6131,6 +6147,7 @@ export type AsyncSearchStatusResponse = AsyncSearchStatusStatusResponseBase export interface AsyncSearchStatusStatusResponseBase extends AsyncSearchAsyncSearchResponseBase { _shards: ShardStatistics + _clusters?: ClusterStatistics completion_status?: integer } From beaee47ca0c0db89c360385e7f330ba6767db983 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Thu, 7 Sep 2023 00:56:15 +0930 Subject: [PATCH 4/6] Auto-generated code for main (#2001) --- docs/reference.asciidoc | 93 ++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 1ddd6e5f7..bb88c67fc 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -38,17 +38,21 @@ client.bulk({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string)*: Default index for items which don't provide one +** *`index` (Optional, string)*: Name of the data stream, index, or index alias to perform bulk actions on. ** *`operations` (Optional, { index, create, update, delete } | { detect_noop, doc, doc_as_upsert, script, scripted_upsert, _source, upsert } | object[])* -** *`pipeline` (Optional, string)*: The pipeline id to preprocess incoming documents with -** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. -** *`routing` (Optional, string)*: Specific routing value -** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request -** *`_source_excludes` (Optional, string | string[])*: Default list of fields to exclude from the returned _source field, can be overridden on each sub-request -** *`_source_includes` (Optional, string | string[])*: Default list of fields to extract and return from the _source field, can be overridden on each sub-request -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -** *`require_alias` (Optional, boolean)*: Sets require_alias for all incoming documents. Defaults to unset (false) +** *`pipeline` (Optional, string)*: ID of the pipeline to use to preprocess incoming documents. +If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. +If a final pipeline is configured it will always run, regardless of the value of this parameter. +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. +Valid values: `true`, `false`, `wait_for`. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`_source` (Optional, boolean | string | string[])*: `true` or `false` to return the `_source` field or not, or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude from the response. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`timeout` (Optional, string | -1 | 0)*: Period each action waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`require_alias` (Optional, boolean)*: If `true`, the request’s actions must target an index alias. [discrete] === clear_scroll @@ -63,7 +67,8 @@ client.clearScroll({ ... }) ==== Arguments * *Request (object):* -** *`scroll_id` (Optional, string | string[])*: A list of scroll IDs to clear +** *`scroll_id` (Optional, string | string[])*: List of scroll IDs to clear. +To clear all scroll IDs, use `_all`. [discrete] === close_point_in_time @@ -78,7 +83,7 @@ client.closePointInTime({ id }) ==== Arguments * *Request (object):* -** *`id` (string)* +** *`id` (string)*: The ID of the point-in-time. [discrete] === count @@ -623,20 +628,22 @@ client.mtermvectors({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string)*: The index in which the document resides. -** *`docs` (Optional, { _id, _index, routing, _source, stored_fields, version, version_type }[])* -** *`ids` (Optional, string[])* -** *`fields` (Optional, string | string[])*: A list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`field_statistics` (Optional, boolean)*: Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`offsets` (Optional, boolean)*: Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`payloads` (Optional, boolean)*: Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`positions` (Optional, boolean)*: Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`realtime` (Optional, boolean)*: Specifies if requests are real-time as opposed to near-real-time (default: true). -** *`routing` (Optional, string)*: Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`term_statistics` (Optional, boolean)*: Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type +** *`index` (Optional, string)*: Name of the index that contains the documents. +** *`docs` (Optional, { _id, _index, routing, _source, stored_fields, version, version_type }[])*: Array of existing or artificial documents. +** *`ids` (Optional, string[])*: Simplified syntax to specify documents by their ID if they're in the same index. +** *`fields` (Optional, string | string[])*: List or wildcard expressions of fields to include in the statistics. +Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. +** *`field_statistics` (Optional, boolean)*: If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. +** *`offsets` (Optional, boolean)*: If `true`, the response includes term offsets. +** *`payloads` (Optional, boolean)*: If `true`, the response includes term payloads. +** *`positions` (Optional, boolean)*: If `true`, the response includes term positions. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`realtime` (Optional, boolean)*: If true, the request is real-time as opposed to near-real-time. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`term_statistics` (Optional, boolean)*: If true, the response includes term frequency and document frequency. +** *`version` (Optional, number)*: If `true`, returns the document version as part of a hit. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type. [discrete] === open_point_in_time @@ -1106,22 +1113,24 @@ client.termvectors({ index }) ==== Arguments * *Request (object):* -** *`index` (string)*: The index in which the document resides. -** *`id` (Optional, string)*: The id of the document, when not specified a doc param should be supplied. -** *`doc` (Optional, object)*: A document. -** *`filter` (Optional, { max_doc_freq, max_num_terms, max_term_freq, max_word_length, min_doc_freq, min_term_freq, min_word_length })* -** *`per_field_analyzer` (Optional, Record)* -** *`fields` (Optional, string | string[])*: A list of fields to return. -** *`field_statistics` (Optional, boolean)*: Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. -** *`offsets` (Optional, boolean)*: Specifies if term offsets should be returned. -** *`payloads` (Optional, boolean)*: Specifies if term payloads should be returned. -** *`positions` (Optional, boolean)*: Specifies if term positions should be returned. -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random). -** *`realtime` (Optional, boolean)*: Specifies if request is real-time as opposed to near-real-time (default: true). -** *`routing` (Optional, string)*: Specific routing value. -** *`term_statistics` (Optional, boolean)*: Specifies if total term frequency and document frequency should be returned. -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type +** *`index` (string)*: Name of the index that contains the document. +** *`id` (Optional, string)*: Unique identifier of the document. +** *`doc` (Optional, object)*: An artificial document (a document not present in the index) for which you want to retrieve term vectors. +** *`filter` (Optional, { max_doc_freq, max_num_terms, max_term_freq, max_word_length, min_doc_freq, min_term_freq, min_word_length })*: Filter terms based on their tf-idf scores. +** *`per_field_analyzer` (Optional, Record)*: Overrides the default per-field analyzer. +** *`fields` (Optional, string | string[])*: List or wildcard expressions of fields to include in the statistics. +Used as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters. +** *`field_statistics` (Optional, boolean)*: If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies. +** *`offsets` (Optional, boolean)*: If `true`, the response includes term offsets. +** *`payloads` (Optional, boolean)*: If `true`, the response includes term payloads. +** *`positions` (Optional, boolean)*: If `true`, the response includes term positions. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`realtime` (Optional, boolean)*: If true, the request is real-time as opposed to near-real-time. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`term_statistics` (Optional, boolean)*: If `true`, the response includes term frequency and document frequency. +** *`version` (Optional, number)*: If `true`, returns the document version as part of a hit. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type. [discrete] === update From ff0fb27ebe41274ed94e5ed976211dbf53aa2774 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Thu, 7 Sep 2023 23:57:59 +0930 Subject: [PATCH 5/6] Auto-generated code for main (#2002) --- docs/reference.asciidoc | 259 ++++++++++++++++++++++++---------------- 1 file changed, 156 insertions(+), 103 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index bb88c67fc..5a83622c9 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -142,16 +142,23 @@ client.create({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: Document ID -** *`index` (string)*: The name of the index +** *`id` (string)*: Unique identifier for the document. +** *`index` (string)*: Name of the data stream or index to target. +If the target doesn’t exist and matches the name or wildcard (`*`) pattern of an index template with a `data_stream` definition, this request creates the data stream. +If the target doesn’t exist and doesn’t match a data stream template, this request creates the index. ** *`document` (Optional, object)*: A document. -** *`pipeline` (Optional, string)*: The pipeline id to preprocess incoming documents with -** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. -** *`routing` (Optional, string)*: Specific routing value -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) +** *`pipeline` (Optional, string)*: ID of the pipeline to use to preprocess incoming documents. +If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. +If a final pipeline is configured it will always run, regardless of the value of this parameter. +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. +Valid values: `true`, `false`, `wait_for`. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`timeout` (Optional, string | -1 | 0)*: Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). [discrete] === delete @@ -166,16 +173,19 @@ client.delete({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: The document ID -** *`index` (string)*: The name of the index -** *`if_primary_term` (Optional, number)*: only perform the delete operation if the last operation that has changed the document has the specified primary term -** *`if_seq_no` (Optional, number)*: only perform the delete operation if the last operation that has changed the document has the specified sequence number -** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. -** *`routing` (Optional, string)*: Specific routing value -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) +** *`id` (string)*: Unique identifier for the document. +** *`index` (string)*: Name of the target index. +** *`if_primary_term` (Optional, number)*: Only perform the operation if the document has this primary term. +** *`if_seq_no` (Optional, number)*: Only perform the operation if the document has this sequence number. +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. +Valid values: `true`, `false`, `wait_for`. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`timeout` (Optional, string | -1 | 0)*: Period to wait for active shards. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). [discrete] === delete_by_query @@ -190,38 +200,55 @@ client.deleteByQuery({ index }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names to search; use `_all` or empty string to perform the operation on all indices -** *`max_docs` (Optional, number)* -** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })* -** *`slice` (Optional, { field, id, max })* -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`analyzer` (Optional, string)*: The analyzer to use for the query string -** *`analyze_wildcard` (Optional, boolean)*: Specify whether wildcard and prefix queries should be analyzed (default: false) -** *`conflicts` (Optional, Enum("abort" | "proceed"))*: What to do when the delete by query hits version conflicts? -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query (AND or OR) -** *`df` (Optional, string)*: The field to use as default where no field prefix is given in the query string -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. +** *`index` (string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams or indices, omit this parameter or use `*` or `_all`. +** *`max_docs` (Optional, number)*: The maximum number of documents to delete. +** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })*: Specifies the documents to delete using the Query DSL. +** *`slice` (Optional, { field, id, max })*: Slice the request manually using the provided slice ID and total number of slices. +** *`allow_no_indices` (Optional, boolean)*: 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`. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +** *`conflicts` (Optional, Enum("abort" | "proceed"))*: What to do if delete by query hits version conflicts: `abort` or `proceed`. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: 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 a list of values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. ** *`from` (Optional, number)*: Starting offset (default: 0) -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`refresh` (Optional, boolean)*: Should the affected indexes be refreshed? -** *`request_cache` (Optional, boolean)*: Specify if request cache should be used for this request or not, defaults to index level setting -** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. -1 means no throttle. -** *`routing` (Optional, string)*: A list of specific routing values -** *`q` (Optional, string)*: Query in the Lucene query string syntax -** *`scroll` (Optional, string | -1 | 0)*: Specify how long a consistent view of the index should be maintained for scrolled search -** *`scroll_size` (Optional, number)*: Size on the scroll request powering the delete by query -** *`search_timeout` (Optional, string | -1 | 0)*: Explicit timeout for each search request. Defaults to no timeout. -** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: Search operation type -** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. -** *`sort` (Optional, string[])*: A list of : pairs -** *`stats` (Optional, string[])*: Specific 'tag' of the request for logging and statistical purposes -** *`terminate_after` (Optional, number)*: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -** *`timeout` (Optional, string | -1 | 0)*: Time each individual bulk request should wait for shards that are unavailable. -** *`version` (Optional, boolean)*: Specify whether to return document version as part of a hit -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -** *`wait_for_completion` (Optional, boolean)*: Should the request should block until the delete by query is complete. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`refresh` (Optional, boolean)*: If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes. +** *`request_cache` (Optional, boolean)*: If `true`, the request cache is used for this request. +Defaults to the index-level setting. +** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`q` (Optional, string)*: Query in the Lucene query string syntax. +** *`scroll` (Optional, string | -1 | 0)*: Period to retain the search context for scrolling. +** *`scroll_size` (Optional, number)*: Size of the scroll request that powers the operation. +** *`search_timeout` (Optional, string | -1 | 0)*: Explicit timeout for each search request. +Defaults to no timeout. +** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. +Available options: `query_then_fetch`, `dfs_query_then_fetch`. +** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. +** *`sort` (Optional, string[])*: A list of : pairs. +** *`stats` (Optional, string[])*: Specific `tag` of the request for logging and statistical purposes. +** *`terminate_after` (Optional, number)*: Maximum number of documents to collect for each shard. +If a query reaches this limit, Elasticsearch terminates the query early. +Elasticsearch collects documents before sorting. +Use with caution. +Elasticsearch applies this parameter to each shard handling the request. +When possible, let Elasticsearch perform early termination automatically. +Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. +** *`timeout` (Optional, string | -1 | 0)*: Period each deletion request waits for active shards. +** *`version` (Optional, boolean)*: If `true`, returns the document version as part of a hit. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`wait_for_completion` (Optional, boolean)*: If `true`, the request blocks until the operation is complete. [discrete] === delete_by_query_rethrottle @@ -236,8 +263,8 @@ client.deleteByQueryRethrottle({ task_id }) ==== Arguments * *Request (object):* -** *`task_id` (string | number)*: The task id to rethrottle -** *`requests_per_second` (Optional, float)*: The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. +** *`task_id` (string | number)*: The ID for the task. +** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. [discrete] === delete_script @@ -252,9 +279,11 @@ client.deleteScript({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: Script ID -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout +** *`id` (string)*: Identifier for the stored script or search template. +** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. +If no response is received before the timeout expires, the request fails and returns an error. +** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. +If no response is received before the timeout expires, the request fails and returns an error. [discrete] === exists @@ -402,7 +431,7 @@ client.getScript({ id }) ==== Arguments * *Request (object):* -** *`id` (string)*: Script ID +** *`id` (string)*: Identifier for the stored script or search template. ** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master [discrete] @@ -659,11 +688,14 @@ client.openPointInTime({ index, keep_alive }) * *Request (object):* ** *`index` (string | string[])*: A list of index names to open point in time; use `_all` or empty string to perform the operation on all indices -** *`keep_alive` (string | -1 | 0)*: Specific the time to live for the point in time -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`routing` (Optional, string)*: Specific routing value -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. +** *`keep_alive` (string | -1 | 0)*: Extends the time to live of the corresponding point in time. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: 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 a list of values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. [discrete] === ping @@ -688,11 +720,15 @@ client.putScript({ id, script }) ==== Arguments * *Request (object):* -** *`id` (string)*: Script ID -** *`script` ({ lang, options, source })* -** *`context` (Optional, string)*: Script context -** *`master_timeout` (Optional, string | -1 | 0)*: Specify timeout for connection to master -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout +** *`id` (string)*: Identifier for the stored script or search template. +Must be unique within the cluster. +** *`script` ({ lang, options, source })*: Contains the script or search template, its parameters, and its language. +** *`context` (Optional, string)*: Context in which the script or search template should run. +To prevent errors, the API immediately compiles the script or template in this context. +** *`master_timeout` (Optional, string | -1 | 0)*: Period to wait for a connection to the master node. +If no response is received before the timeout expires, the request fails and returns an error. +** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. +If no response is received before the timeout expires, the request fails and returns an error. [discrete] === rank_eval @@ -796,9 +832,9 @@ client.scriptsPainlessExecute({ ... }) ==== Arguments * *Request (object):* -** *`context` (Optional, string)* -** *`context_setup` (Optional, { document, index, query })* -** *`script` (Optional, { lang, options, source })* +** *`context` (Optional, string)*: The context that the script should run in. +** *`context_setup` (Optional, { document, index, query })*: Additional parameters for the `context`. +** *`script` (Optional, { lang, options, source })*: The Painless script to execute. [discrete] === scroll @@ -1189,40 +1225,57 @@ client.updateByQuery({ index }) ==== Arguments * *Request (object):* -** *`index` (string | string[])*: A list of index names to search; use `_all` or empty string to perform the operation on all indices -** *`max_docs` (Optional, number)* -** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })* -** *`script` (Optional, { lang, options, source } | { id })* -** *`slice` (Optional, { field, id, max })* -** *`conflicts` (Optional, Enum("abort" | "proceed"))* -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`analyzer` (Optional, string)*: The analyzer to use for the query string -** *`analyze_wildcard` (Optional, boolean)*: Specify whether wildcard and prefix queries should be analyzed (default: false) -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query (AND or OR) -** *`df` (Optional, string)*: The field to use as default where no field prefix is given in the query string -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. +** *`index` (string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams or indices, omit this parameter or use `*` or `_all`. +** *`max_docs` (Optional, number)*: The maximum number of documents to update. +** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })*: Specifies the documents to update using the Query DSL. +** *`script` (Optional, { lang, options, source } | { id })*: The script to run to update the document source or metadata when updating. +** *`slice` (Optional, { field, id, max })*: Slice the request manually using the provided slice ID and total number of slices. +** *`conflicts` (Optional, Enum("abort" | "proceed"))*: What to do if update by query hits version conflicts: `abort` or `proceed`. +** *`allow_no_indices` (Optional, boolean)*: 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`. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: 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 a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. ** *`from` (Optional, number)*: Starting offset (default: 0) -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -** *`pipeline` (Optional, string)*: Ingest pipeline to set on index requests made by this action. (default: none) -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`refresh` (Optional, boolean)*: Should the affected indexes be refreshed? -** *`request_cache` (Optional, boolean)*: Specify if request cache should be used for this request or not, defaults to index level setting -** *`requests_per_second` (Optional, float)*: The throttle to set on this request in sub-requests per second. -1 means no throttle. -** *`routing` (Optional, string)*: A list of specific routing values -** *`scroll` (Optional, string | -1 | 0)*: Specify how long a consistent view of the index should be maintained for scrolled search -** *`scroll_size` (Optional, number)*: Size on the scroll request powering the update by query -** *`search_timeout` (Optional, string | -1 | 0)*: Explicit timeout for each search request. Defaults to no timeout. -** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: Search operation type -** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. -** *`sort` (Optional, string[])*: A list of : pairs -** *`stats` (Optional, string[])*: Specific 'tag' of the request for logging and statistical purposes -** *`terminate_after` (Optional, number)*: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. -** *`timeout` (Optional, string | -1 | 0)*: Time each individual bulk request should wait for shards that are unavailable. -** *`version` (Optional, boolean)*: Specify whether to return document version as part of a hit +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`pipeline` (Optional, string)*: ID of the pipeline to use to preprocess incoming documents. +If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. +If a final pipeline is configured it will always run, regardless of the value of this parameter. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`refresh` (Optional, boolean)*: If `true`, Elasticsearch refreshes affected shards to make the operation visible to search. +** *`request_cache` (Optional, boolean)*: If `true`, the request cache is used for this request. +** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`scroll` (Optional, string | -1 | 0)*: Period to retain the search context for scrolling. +** *`scroll_size` (Optional, number)*: Size of the scroll request that powers the operation. +** *`search_timeout` (Optional, string | -1 | 0)*: Explicit timeout for each search request. +** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. +** *`slices` (Optional, number | Enum("auto"))*: The number of slices this task should be divided into. +** *`sort` (Optional, string[])*: A list of : pairs. +** *`stats` (Optional, string[])*: Specific `tag` of the request for logging and statistical purposes. +** *`terminate_after` (Optional, number)*: Maximum number of documents to collect for each shard. +If a query reaches this limit, Elasticsearch terminates the query early. +Elasticsearch collects documents before sorting. +Use with caution. +Elasticsearch applies this parameter to each shard handling the request. +When possible, let Elasticsearch perform early termination automatically. +Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. +** *`timeout` (Optional, string | -1 | 0)*: Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards. +** *`version` (Optional, boolean)*: If `true`, returns the document version as part of a hit. ** *`version_type` (Optional, boolean)*: Should the document increment the version number (internal) on hit or not (reindex) -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -** *`wait_for_completion` (Optional, boolean)*: Should the request should block until the update by query operation is complete. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`wait_for_completion` (Optional, boolean)*: If `true`, the request blocks until the operation is complete. [discrete] === update_by_query_rethrottle @@ -1237,8 +1290,8 @@ client.updateByQueryRethrottle({ task_id }) ==== Arguments * *Request (object):* -** *`task_id` (string)*: The task id to rethrottle -** *`requests_per_second` (Optional, float)*: The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. +** *`task_id` (string)*: The ID for the task. +** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. [discrete] === async_search From 9e47fe2d3edc0ee76d7251da2721053c479502d0 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Sat, 9 Sep 2023 03:40:13 +0930 Subject: [PATCH 6/6] Auto-generated code for main (#2004) --- docs/reference.asciidoc | 209 ++++++++++++++++++++++++---------------- 1 file changed, 128 insertions(+), 81 deletions(-) diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 5a83622c9..c9ef99a1a 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -298,18 +298,23 @@ client.exists({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: The document ID -** *`index` (string)*: The name of the index -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`realtime` (Optional, boolean)*: Specify whether to perform the operation in realtime or search mode -** *`refresh` (Optional, boolean)*: Refresh the shard containing the document before performing the operation -** *`routing` (Optional, string)*: Specific routing value -** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or a list of fields to return -** *`_source_excludes` (Optional, string | string[])*: A list of fields to exclude from the returned _source field -** *`_source_includes` (Optional, string | string[])*: A list of fields to extract and return from the _source field -** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return in the response -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type +** *`id` (string)*: Identifier of the document. +** *`index` (string)*: List of data streams, indices, and aliases. +Supports wildcards (`*`). +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`realtime` (Optional, boolean)*: If `true`, the request is real-time as opposed to near-real-time. +** *`refresh` (Optional, boolean)*: If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes. +** *`routing` (Optional, string)*: Target the specified primary shard. +** *`_source` (Optional, boolean | string | string[])*: `true` or `false` to return the `_source` field or not, or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude in the response. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`stored_fields` (Optional, string | string[])*: List of stored fields to return as part of a hit. +If no fields are specified, no stored fields are included in the response. +If this field is specified, the `_source` parameter defaults to false. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. [discrete] === exists_source @@ -324,17 +329,20 @@ client.existsSource({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: The document ID -** *`index` (string)*: The name of the index -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`realtime` (Optional, boolean)*: Specify whether to perform the operation in realtime or search mode -** *`refresh` (Optional, boolean)*: Refresh the shard containing the document before performing the operation -** *`routing` (Optional, string)*: Specific routing value -** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or a list of fields to return -** *`_source_excludes` (Optional, string | string[])*: A list of fields to exclude from the returned _source field -** *`_source_includes` (Optional, string | string[])*: A list of fields to extract and return from the _source field -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type +** *`id` (string)*: Identifier of the document. +** *`index` (string)*: List of data streams, indices, and aliases. +Supports wildcards (`*`). +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`realtime` (Optional, boolean)*: If true, the request is real-time as opposed to near-real-time. +** *`refresh` (Optional, boolean)*: If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes. +** *`routing` (Optional, string)*: Target the specified primary shard. +** *`_source` (Optional, boolean | string | string[])*: `true` or `false` to return the `_source` field or not, or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude in the response. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. [discrete] === explain @@ -349,21 +357,24 @@ client.explain({ id, index }) ==== Arguments * *Request (object):* -** *`id` (string)*: The document ID -** *`index` (string)*: The name of the index -** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })* -** *`analyzer` (Optional, string)*: The analyzer for the query string query -** *`analyze_wildcard` (Optional, boolean)*: Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) -** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query (AND or OR) -** *`df` (Optional, string)*: The default field for query string query (default: _all) -** *`lenient` (Optional, boolean)*: Specify whether format-based query failures (such as providing text to a numeric field) should be ignored -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`routing` (Optional, string)*: Specific routing value -** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or a list of fields to return -** *`_source_excludes` (Optional, string | string[])*: A list of fields to exclude from the returned _source field -** *`_source_includes` (Optional, string | string[])*: A list of fields to extract and return from the _source field -** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return in the response -** *`q` (Optional, string)*: Query in the Lucene query string syntax +** *`id` (string)*: Defines the document ID. +** *`index` (string)*: Index names used to limit the request. +Only a single index name can be provided to this parameter. +** *`query` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })*: Defines the search definition using the Query DSL. +** *`analyzer` (Optional, string)*: Analyzer to use for the query string. +This parameter can only be used when the `q` query string parameter is specified. +** *`analyze_wildcard` (Optional, boolean)*: If `true`, wildcard and prefix queries are analyzed. +** *`default_operator` (Optional, Enum("and" | "or"))*: The default operator for query string query: `AND` or `OR`. +** *`df` (Optional, string)*: Field to use as default where no field prefix is given in the query string. +** *`lenient` (Optional, boolean)*: If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`_source` (Optional, boolean | string | string[])*: True or false to return the `_source` field or not, or a list of fields to return. +** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude from the response. +** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. +** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return in the response. +** *`q` (Optional, string)*: Query in the Lucene query string syntax. [discrete] === field_caps @@ -408,13 +419,15 @@ client.get({ id, index }) ** *`id` (string)*: Unique identifier of the document. ** *`index` (string)*: Name of the index that contains the document. ** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. Random by default. -** *`realtime` (Optional, boolean)*: Boolean) If true, the request is real-time as opposed to near-real-time. +** *`realtime` (Optional, boolean)*: If `true`, the request is real-time as opposed to near-real-time. ** *`refresh` (Optional, boolean)*: If true, Elasticsearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. ** *`routing` (Optional, string)*: Target the specified primary shard. ** *`_source` (Optional, boolean | string | string[])*: True or false to return the _source field or not, or a list of fields to return. ** *`_source_excludes` (Optional, string | string[])*: A list of source fields to exclude in the response. ** *`_source_includes` (Optional, string | string[])*: A list of source fields to include in the response. -** *`stored_fields` (Optional, string | string[])*: A list of stored fields to return in the response +** *`stored_fields` (Optional, string | string[])*: List of stored fields to return as part of a hit. +If no fields are specified, no stored fields are included in the response. +If this field is specified, the `_source` parameter defaults to false. ** *`version` (Optional, number)*: Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed. ** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: internal, external, external_gte. @@ -511,20 +524,30 @@ client.index({ index }) ==== Arguments * *Request (object):* -** *`index` (string)*: The name of the index -** *`id` (Optional, string)*: Document ID +** *`index` (string)*: Name of the data stream or index to target. +** *`id` (Optional, string)*: Unique identifier for the document. ** *`document` (Optional, object)*: A document. -** *`if_primary_term` (Optional, number)*: only perform the index operation if the last operation that has changed the document has the specified primary term -** *`if_seq_no` (Optional, number)*: only perform the index operation if the last operation that has changed the document has the specified sequence number -** *`op_type` (Optional, Enum("index" | "create"))*: Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID -** *`pipeline` (Optional, string)*: The pipeline id to preprocess incoming documents with -** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. -** *`routing` (Optional, string)*: Specific routing value -** *`timeout` (Optional, string | -1 | 0)*: Explicit operation timeout -** *`version` (Optional, number)*: Explicit version number for concurrency control -** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type -** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) -** *`require_alias` (Optional, boolean)*: When true, requires destination to be an alias. Default is false +** *`if_primary_term` (Optional, number)*: Only perform the operation if the document has this primary term. +** *`if_seq_no` (Optional, number)*: Only perform the operation if the document has this sequence number. +** *`op_type` (Optional, Enum("index" | "create"))*: Set to create to only index the document if it does not already exist (put if absent). +If a document with the specified `_id` already exists, the indexing operation will fail. +Same as using the `/_create` endpoint. +Valid values: `index`, `create`. +If document id is specified, it defaults to `index`. +Otherwise, it defaults to `create`. +** *`pipeline` (Optional, string)*: ID of the pipeline to use to preprocess incoming documents. +If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. +If a final pipeline is configured it will always run, regardless of the value of this parameter. +** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` do nothing with refreshes. +Valid values: `true`, `false`, `wait_for`. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. +** *`timeout` (Optional, string | -1 | 0)*: Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. +** *`version` (Optional, number)*: Explicit version number for concurrency control. +The specified version must match the current version of the document for the request to succeed. +** *`version_type` (Optional, Enum("internal" | "external" | "external_gte" | "force"))*: Specific version type: `external`, `external_gte`. +** *`wait_for_active_shards` (Optional, number | Enum("all" | "index-setting"))*: The number of shard copies that must be active before proceeding with the operation. +Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). +** *`require_alias` (Optional, boolean)*: If `true`, the destination must be an index alias. [discrete] === info @@ -636,13 +659,17 @@ client.msearchTemplate({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: A list of index names to use as default +** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. +Supports wildcards (`*`). +To search all data streams and indices, omit this parameter or use `*`. ** *`search_templates` (Optional, { allow_no_indices, expand_wildcards, ignore_unavailable, index, preference, request_cache, routing, search_type, ccs_minimize_roundtrips, allow_partial_search_results, ignore_throttled } | { aggregations, collapse, query, explain, ext, stored_fields, docvalue_fields, knn, from, highlight, indices_boost, min_score, post_filter, profile, rescore, script_fields, search_after, size, sort, _source, fields, terminate_after, stats, timeout, track_scores, track_total_hits, version, runtime_mappings, seq_no_primary_term, pit, suggest }[])* -** *`ccs_minimize_roundtrips` (Optional, boolean)*: Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution -** *`max_concurrent_searches` (Optional, number)*: Controls the maximum number of concurrent searches the multi search api will execute -** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: Search operation type -** *`rest_total_hits_as_int` (Optional, boolean)*: Indicates whether hits.total should be rendered as an integer or an object in the rest search response -** *`typed_keys` (Optional, boolean)*: Specify whether aggregation and suggester names should be prefixed by their respective types in the response +** *`ccs_minimize_roundtrips` (Optional, boolean)*: If `true`, network round-trips are minimized for cross-cluster search requests. +** *`max_concurrent_searches` (Optional, number)*: Maximum number of concurrent searches the API can run. +** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. +Available options: `query_then_fetch`, `dfs_query_then_fetch`. +** *`rest_total_hits_as_int` (Optional, boolean)*: If `true`, the response returns `hits.total` as an integer. +If `false`, it returns `hits.total` as an object. +** *`typed_keys` (Optional, boolean)*: If `true`, the response prefixes aggregation and suggester names with their respective types. [discrete] === mtermvectors @@ -798,8 +825,8 @@ client.reindexRethrottle({ task_id }) ==== Arguments * *Request (object):* -** *`task_id` (string)*: The task id to rethrottle -** *`requests_per_second` (Optional, float)*: The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. +** *`task_id` (string)*: Identifier for the task. +** *`requests_per_second` (Optional, float)*: The throttle for this request in sub-requests per second. [discrete] === render_search_template @@ -814,10 +841,16 @@ client.renderSearchTemplate({ ... }) ==== Arguments * *Request (object):* -** *`id` (Optional, string)*: The id of the stored search template +** *`id` (Optional, string)*: ID of the search template to render. +If no `source` is specified, this or the `id` request body parameter is required. ** *`file` (Optional, string)* -** *`params` (Optional, Record)* -** *`source` (Optional, string)* +** *`params` (Optional, Record)*: Key-value pairs used to replace Mustache variables in the template. +The key is the variable name. +The value is the variable value. +** *`source` (Optional, string)*: An inline search template. +Supports the same parameters as the search API's request body. +These parameters also support Mustache variables. +If no `id` or `` is specified, this parameter is required. [discrete] === scripts_painless_execute @@ -1070,13 +1103,19 @@ client.searchShards({ ... }) ==== Arguments * *Request (object):* -** *`index` (Optional, string | string[])*: A list of index names to search; use `_all` or empty string to perform the operation on all indices -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`local` (Optional, boolean)*: Return local information, do not retrieve the state from master node (default: false) -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) -** *`routing` (Optional, string)*: Specific routing value +** *`index` (Optional, string | string[])*: Returns the indices and shards that a search request would be executed against. +** *`allow_no_indices` (Optional, boolean)*: 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`. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: 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 a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`local` (Optional, boolean)*: If `true`, the request retrieves information from the local node only. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. +** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. [discrete] === search_template @@ -1093,26 +1132,34 @@ client.searchTemplate({ ... }) * *Request (object):* ** *`index` (Optional, string | string[])*: List of data streams, indices, and aliases to search. Supports wildcards (*). -** *`explain` (Optional, boolean)* +** *`explain` (Optional, boolean)*: If `true`, returns detailed information about score calculation as part of each hit. ** *`id` (Optional, string)*: ID of the search template to use. If no source is specified, this parameter is required. -** *`params` (Optional, Record)* -** *`profile` (Optional, boolean)* +** *`params` (Optional, Record)*: Key-value pairs used to replace Mustache variables in the template. +The key is the variable name. +The value is the variable value. +** *`profile` (Optional, boolean)*: If `true`, the query execution is profiled. ** *`source` (Optional, string)*: An inline search template. Supports the same parameters as the search API's request body. Also supports Mustache variables. If no id is specified, this parameter is required. -** *`allow_no_indices` (Optional, boolean)*: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) -** *`ccs_minimize_roundtrips` (Optional, boolean)*: Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution -** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Whether to expand wildcard expression to concrete indices that are open, closed or both. -** *`ignore_throttled` (Optional, boolean)*: Whether specified concrete, expanded or aliased indices should be ignored when throttled -** *`ignore_unavailable` (Optional, boolean)*: Whether specified concrete indices should be ignored when unavailable (missing or closed) -** *`preference` (Optional, string)*: Specify the node or shard the operation should be performed on (default: random) +** *`allow_no_indices` (Optional, boolean)*: 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`. +** *`ccs_minimize_roundtrips` (Optional, boolean)*: If `true`, network round-trips are minimized for cross-cluster search requests. +** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: 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 a list of values, such as `open,hidden`. +Valid values are: `all`, `open`, `closed`, `hidden`, `none`. +** *`ignore_throttled` (Optional, boolean)*: If `true`, specified concrete, expanded, or aliased indices are not included in the response when throttled. +** *`ignore_unavailable` (Optional, boolean)*: If `false`, the request returns an error if it targets a missing or closed index. +** *`preference` (Optional, string)*: Specifies the node or shard the operation should be performed on. +Random by default. ** *`routing` (Optional, string)*: Custom value used to route operations to a specific shard. ** *`scroll` (Optional, string | -1 | 0)*: Specifies how long a consistent view of the index should be maintained for scrolled search. ** *`search_type` (Optional, Enum("query_then_fetch" | "dfs_query_then_fetch"))*: The type of the search operation. ** *`rest_total_hits_as_int` (Optional, boolean)*: If true, hits.total are rendered as an integer in the response. -** *`typed_keys` (Optional, boolean)*: Specify whether aggregation and suggester names should be prefixed by their respective types in the response +** *`typed_keys` (Optional, boolean)*: If `true`, the response prefixes aggregation and suggester names with their respective types. [discrete] === terms_enum