From ad975f6970d7952925a05475f032ac2c8754fc52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= <szabosteve@gmail.com> Date: Wed, 6 Sep 2023 17:50:30 +0200 Subject: [PATCH] [DOCS] Adds description to global APIs part 2 (#2270) Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co> --- output/schema/schema.json | 282 +++++++++++------- specification/_global/create/CreateRequest.ts | 43 ++- specification/_global/delete/DeleteRequest.ts | 37 +++ .../delete_by_query/DeleteByQueryRequest.ts | 128 ++++++++ .../DeleteByQueryRethrottleRequest.ts | 6 + .../delete_script/DeleteScriptRequest.ts | 14 + .../_global/get_script/GetScriptRequest.ts | 4 + .../OpenPointInTimeRequest.ts | 20 ++ .../_global/put_script/PutScriptRequest.ts | 22 ++ .../ExecutePainlessScriptRequest.ts | 11 + .../_global/scripts_painless_execute/types.ts | 10 + .../update_by_query/UpdateByQueryRequest.ts | 136 +++++++++ .../UpdateByQueryRethrottleRequest.ts | 7 + 13 files changed, 605 insertions(+), 115 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 9ee0726deb..6863ddeeff 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -20353,7 +20353,7 @@ } } }, - "description": "Creates a new document in the index.\n\nReturns a 409 response when a document with a same ID already exists in the index.", + "description": "Adds a JSON document to the specified data stream or index and makes it searchable.\nIf the target is an index and the document already exists, the request updates the document and increments its version.", "generics": [ { "name": "TDocument", @@ -20373,7 +20373,7 @@ }, "path": [ { - "description": "Document ID", + "description": "Unique identifier for the document.", "name": "id", "required": true, "type": { @@ -20385,7 +20385,7 @@ } }, { - "description": "The name of the index", + "description": "Name of the data stream or index to target.\nIf 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.\nIf the target doesn’t exist and doesn’t match a data stream template, this request creates the index.", "name": "index", "required": true, "type": { @@ -20399,7 +20399,7 @@ ], "query": [ { - "description": "The pipeline id to preprocess incoming documents with", + "description": "ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.", "name": "pipeline", "required": false, "type": { @@ -20411,9 +20411,10 @@ } }, { - "description": "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.", + "description": "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.\nValid values: `true`, `false`, `wait_for`.", "name": "refresh", "required": false, + "serverDefault": "false", "type": { "kind": "instance_of", "type": { @@ -20423,7 +20424,7 @@ } }, { - "description": "Specific routing value", + "description": "Custom value used to route operations to a specific shard.", "name": "routing", "required": false, "type": { @@ -20435,9 +20436,10 @@ } }, { - "description": "Explicit operation timeout", + "description": "Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.", "name": "timeout", "required": false, + "serverDefault": "1m", "type": { "kind": "instance_of", "type": { @@ -20447,7 +20449,7 @@ } }, { - "description": "Explicit version number for concurrency control", + "description": "Explicit version number for concurrency control.\nThe specified version must match the current version of the document for the request to succeed.", "name": "version", "required": false, "type": { @@ -20459,7 +20461,7 @@ } }, { - "description": "Specific version type", + "description": "Specific version type: `external`, `external_gte`.", "name": "version_type", "required": false, "type": { @@ -20471,9 +20473,10 @@ } }, { - "description": "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)", + "description": "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).", "name": "wait_for_active_shards", "required": false, + "serverDefault": "1", "type": { "kind": "instance_of", "type": { @@ -20483,7 +20486,7 @@ } } ], - "specLocation": "_global/create/CreateRequest.ts#L32-L54" + "specLocation": "_global/create/CreateRequest.ts#L32-L95" }, { "body": { @@ -20510,7 +20513,7 @@ "body": { "kind": "no_body" }, - "description": "Removes a document from the index.", + "description": "Removes a JSON document from the specified index.", "inherits": { "type": { "name": "RequestBase", @@ -20524,7 +20527,7 @@ }, "path": [ { - "description": "The document ID", + "description": "Unique identifier for the document.", "name": "id", "required": true, "type": { @@ -20536,7 +20539,7 @@ } }, { - "description": "The name of the index", + "description": "Name of the target index.", "name": "index", "required": true, "type": { @@ -20550,7 +20553,7 @@ ], "query": [ { - "description": "only perform the delete operation if the last operation that has changed the document has the specified primary term", + "description": "Only perform the operation if the document has this primary term.", "name": "if_primary_term", "required": false, "type": { @@ -20562,7 +20565,7 @@ } }, { - "description": "only perform the delete operation if the last operation that has changed the document has the specified sequence number", + "description": "Only perform the operation if the document has this sequence number.", "name": "if_seq_no", "required": false, "type": { @@ -20574,9 +20577,10 @@ } }, { - "description": "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.", + "description": "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.\nValid values: `true`, `false`, `wait_for`.", "name": "refresh", "required": false, + "serverDefault": "false", "type": { "kind": "instance_of", "type": { @@ -20586,7 +20590,7 @@ } }, { - "description": "Specific routing value", + "description": "Custom value used to route operations to a specific shard.", "name": "routing", "required": false, "type": { @@ -20598,9 +20602,10 @@ } }, { - "description": "Explicit operation timeout", + "description": "Period to wait for active shards.", "name": "timeout", "required": false, + "serverDefault": "1m", "type": { "kind": "instance_of", "type": { @@ -20610,7 +20615,7 @@ } }, { - "description": "Explicit version number for concurrency control", + "description": "Explicit version number for concurrency control.\nThe specified version must match the current version of the document for the request to succeed.", "name": "version", "required": false, "type": { @@ -20622,7 +20627,7 @@ } }, { - "description": "Specific version type", + "description": "Specific version type: `external`, `external_gte`.", "name": "version_type", "required": false, "type": { @@ -20634,9 +20639,10 @@ } }, { - "description": "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)", + "description": "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).", "name": "wait_for_active_shards", "required": false, + "serverDefault": "1", "type": { "kind": "instance_of", "type": { @@ -20646,7 +20652,7 @@ } } ], - "specLocation": "_global/delete/DeleteRequest.ts#L34-L54" + "specLocation": "_global/delete/DeleteRequest.ts#L34-L91" }, { "body": { @@ -20704,6 +20710,7 @@ "kind": "properties", "properties": [ { + "description": "The maximum number of documents to delete.", "name": "max_docs", "required": false, "type": { @@ -20715,6 +20722,7 @@ } }, { + "description": "Specifies the documents to delete using the Query DSL.", "name": "query", "required": false, "type": { @@ -20738,7 +20746,7 @@ } ] }, - "description": "Deletes documents matching the provided query.", + "description": "Deletes documents that match the specified query.", "inherits": { "type": { "name": "RequestBase", @@ -20752,7 +20760,7 @@ }, "path": [ { - "description": "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices", + "description": "Comma-separated list of data streams, indices, and aliases to search.\nSupports wildcards (`*`).\nTo search all data streams or indices, omit this parameter or use `*` or `_all`.", "name": "index", "required": true, "type": { @@ -20766,9 +20774,10 @@ ], "query": [ { - "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)", + "description": "If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.", "name": "allow_no_indices", "required": false, + "serverDefault": true, "type": { "kind": "instance_of", "type": { @@ -20778,7 +20787,7 @@ } }, { - "description": "The analyzer to use for the query string", + "description": "Analyzer to use for the query string.", "name": "analyzer", "required": false, "type": { @@ -20790,9 +20799,10 @@ } }, { - "description": "Specify whether wildcard and prefix queries should be analyzed (default: false)", + "description": "If `true`, wildcard and prefix queries are analyzed.", "name": "analyze_wildcard", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -20802,9 +20812,10 @@ } }, { - "description": "What to do when the delete by query hits version conflicts?", + "description": "What to do if delete by query hits version conflicts: `abort` or `proceed`.", "name": "conflicts", "required": false, + "serverDefault": "abort", "type": { "kind": "instance_of", "type": { @@ -20814,9 +20825,10 @@ } }, { - "description": "The default operator for query string query (AND or OR)", + "description": "The default operator for query string query: `AND` or `OR`.", "name": "default_operator", "required": false, + "serverDefault": "OR", "type": { "kind": "instance_of", "type": { @@ -20826,7 +20838,7 @@ } }, { - "description": "The field to use as default where no field prefix is given in the query string", + "description": "Field to use as default where no field prefix is given in the query string.", "name": "df", "required": false, "type": { @@ -20838,9 +20850,10 @@ } }, { - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.", "name": "expand_wildcards", "required": false, + "serverDefault": "open", "type": { "kind": "instance_of", "type": { @@ -20862,9 +20875,10 @@ } }, { - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)", + "description": "If `false`, the request returns an error if it targets a missing or closed index.", "name": "ignore_unavailable", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -20874,9 +20888,10 @@ } }, { - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored", + "description": "If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.", "name": "lenient", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -20886,7 +20901,7 @@ } }, { - "description": "Maximum number of documents to process (default: all documents)", + "description": "Maximum number of documents to process.\nDefaults to all documents.", "name": "max_docs", "required": false, "type": { @@ -20898,7 +20913,7 @@ } }, { - "description": "Specify the node or shard the operation should be performed on (default: random)", + "description": "Specifies the node or shard the operation should be performed on.\nRandom by default.", "name": "preference", "required": false, "type": { @@ -20910,9 +20925,10 @@ } }, { - "description": "Should the affected indexes be refreshed?", + "description": "If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes.", "name": "refresh", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -20922,7 +20938,7 @@ } }, { - "description": "Specify if request cache should be used for this request or not, defaults to index level setting", + "description": "If `true`, the request cache is used for this request.\nDefaults to the index-level setting.", "name": "request_cache", "required": false, "type": { @@ -20934,7 +20950,7 @@ } }, { - "description": "The throttle for this request in sub-requests per second. -1 means no throttle.", + "description": "The throttle for this request in sub-requests per second.", "name": "requests_per_second", "required": false, "type": { @@ -20946,7 +20962,7 @@ } }, { - "description": "A comma-separated list of specific routing values", + "description": "Custom value used to route operations to a specific shard.", "name": "routing", "required": false, "type": { @@ -20958,7 +20974,7 @@ } }, { - "description": "Query in the Lucene query string syntax", + "description": "Query in the Lucene query string syntax.", "name": "q", "required": false, "type": { @@ -20970,7 +20986,7 @@ } }, { - "description": "Specify how long a consistent view of the index should be maintained for scrolled search", + "description": "Period to retain the search context for scrolling.", "name": "scroll", "required": false, "type": { @@ -20982,9 +20998,10 @@ } }, { - "description": "Size on the scroll request powering the delete by query", + "description": "Size of the scroll request that powers the operation.", "name": "scroll_size", "required": false, + "serverDefault": 1000, "type": { "kind": "instance_of", "type": { @@ -20994,7 +21011,7 @@ } }, { - "description": "Explicit timeout for each search request. Defaults to no timeout.", + "description": "Explicit timeout for each search request.\nDefaults to no timeout.", "name": "search_timeout", "required": false, "type": { @@ -21006,7 +21023,7 @@ } }, { - "description": "Search operation type", + "description": "The type of the search operation.\nAvailable options: `query_then_fetch`, `dfs_query_then_fetch`.", "name": "search_type", "required": false, "type": { @@ -21018,9 +21035,10 @@ } }, { - "description": "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`.", + "description": "The number of slices this task should be divided into.", "name": "slices", "required": false, + "serverDefault": "1", "type": { "kind": "instance_of", "type": { @@ -21030,7 +21048,7 @@ } }, { - "description": "A comma-separated list of <field>:<direction> pairs", + "description": "A comma-separated list of <field>:<direction> pairs.", "name": "sort", "required": false, "type": { @@ -21045,7 +21063,7 @@ } }, { - "description": "Specific 'tag' of the request for logging and statistical purposes", + "description": "Specific `tag` of the request for logging and statistical purposes.", "name": "stats", "required": false, "type": { @@ -21060,7 +21078,7 @@ } }, { - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\nUse with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.", "name": "terminate_after", "required": false, "type": { @@ -21072,9 +21090,10 @@ } }, { - "description": "Time each individual bulk request should wait for shards that are unavailable.", + "description": "Period each deletion request waits for active shards.", "name": "timeout", "required": false, + "serverDefault": "1m", "type": { "kind": "instance_of", "type": { @@ -21084,7 +21103,7 @@ } }, { - "description": "Specify whether to return document version as part of a hit", + "description": "If `true`, returns the document version as part of a hit.", "name": "version", "required": false, "type": { @@ -21096,9 +21115,10 @@ } }, { - "description": "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)", + "description": "The number of shard copies that must be active before proceeding with the operation.\nSet to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).", "name": "wait_for_active_shards", "required": false, + "serverDefault": "1", "type": { "kind": "instance_of", "type": { @@ -21108,9 +21128,10 @@ } }, { - "description": "Should the request should block until the delete by query is complete.", + "description": "If `true`, the request blocks until the operation is complete.", "name": "wait_for_completion", "required": false, + "serverDefault": true, "type": { "kind": "instance_of", "type": { @@ -21120,7 +21141,7 @@ } } ], - "specLocation": "_global/delete_by_query/DeleteByQueryRequest.ts#L36-L81" + "specLocation": "_global/delete_by_query/DeleteByQueryRequest.ts#L36-L206" }, { "body": { @@ -21362,7 +21383,7 @@ }, "path": [ { - "description": "The task id to rethrottle", + "description": "The ID for the task.", "name": "task_id", "required": true, "type": { @@ -21376,7 +21397,7 @@ ], "query": [ { - "description": "The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.", + "description": "The throttle for this request in sub-requests per second.", "name": "requests_per_second", "required": false, "type": { @@ -21388,7 +21409,7 @@ } } ], - "specLocation": "_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts#L24-L35" + "specLocation": "_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts#L24-L41" }, { "body": { @@ -21415,7 +21436,7 @@ "body": { "kind": "no_body" }, - "description": "Deletes a script.", + "description": "Deletes a stored script or search template.", "inherits": { "type": { "name": "RequestBase", @@ -21429,7 +21450,7 @@ }, "path": [ { - "description": "Script ID", + "description": "Identifier for the stored script or search template.", "name": "id", "required": true, "type": { @@ -21443,9 +21464,10 @@ ], "query": [ { - "description": "Specify timeout for connection to master", + "description": "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", "name": "master_timeout", "required": false, + "serverDefault": "30s", "type": { "kind": "instance_of", "type": { @@ -21455,9 +21477,10 @@ } }, { - "description": "Explicit operation timeout", + "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", "name": "timeout", "required": false, + "serverDefault": "30s", "type": { "kind": "instance_of", "type": { @@ -21467,7 +21490,7 @@ } } ], - "specLocation": "_global/delete_script/DeleteScriptRequest.ts#L24-L37" + "specLocation": "_global/delete_script/DeleteScriptRequest.ts#L24-L51" }, { "body": { @@ -23049,7 +23072,7 @@ "body": { "kind": "no_body" }, - "description": "Returns a script.", + "description": "Retrieves a stored script or search template.", "inherits": { "type": { "name": "RequestBase", @@ -23063,7 +23086,7 @@ }, "path": [ { - "description": "Script ID", + "description": "Identifier for the stored script or search template.", "name": "id", "required": true, "type": { @@ -23089,7 +23112,7 @@ } } ], - "specLocation": "_global/get_script/GetScriptRequest.ts#L24-L37" + "specLocation": "_global/get_script/GetScriptRequest.ts#L24-L41" }, { "body": { @@ -27731,7 +27754,7 @@ ], "query": [ { - "description": "Specific the time to live for the point in time", + "description": "Extends the time to live of the corresponding point in time.", "name": "keep_alive", "required": true, "type": { @@ -27743,9 +27766,10 @@ } }, { - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)", + "description": "If `false`, the request returns an error if it targets a missing or closed index.", "name": "ignore_unavailable", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -27755,7 +27779,7 @@ } }, { - "description": "Specify the node or shard the operation should be performed on (default: random)", + "description": "Specifies the node or shard the operation should be performed on.\nRandom by default.", "name": "preference", "required": false, "type": { @@ -27767,7 +27791,7 @@ } }, { - "description": "Specific routing value", + "description": "Custom value used to route operations to a specific shard.", "name": "routing", "required": false, "type": { @@ -27779,9 +27803,10 @@ } }, { - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.", "name": "expand_wildcards", "required": false, + "serverDefault": "open", "type": { "kind": "instance_of", "type": { @@ -27791,7 +27816,7 @@ } } ], - "specLocation": "_global/open_point_in_time/OpenPointInTimeRequest.ts#L24-L48" + "specLocation": "_global/open_point_in_time/OpenPointInTimeRequest.ts#L24-L68" }, { "body": { @@ -27859,6 +27884,7 @@ "kind": "properties", "properties": [ { + "description": "Contains the script or search template, its parameters, and its language.", "name": "script", "required": true, "type": { @@ -27871,7 +27897,7 @@ } ] }, - "description": "Creates or updates a script.", + "description": "Creates or updates a stored script or search template.", "inherits": { "type": { "name": "RequestBase", @@ -27885,7 +27911,7 @@ }, "path": [ { - "description": "Script ID", + "description": "Identifier for the stored script or search template.\nMust be unique within the cluster.", "name": "id", "required": true, "type": { @@ -27897,7 +27923,7 @@ } }, { - "description": "Script context", + "description": "Context in which the script or search template should run.\nTo prevent errors, the API immediately compiles the script or template in this context.", "name": "context", "required": false, "type": { @@ -27911,9 +27937,10 @@ ], "query": [ { - "description": "Specify timeout for connection to master", + "description": "Period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", "name": "master_timeout", "required": false, + "serverDefault": "30s", "type": { "kind": "instance_of", "type": { @@ -27923,9 +27950,10 @@ } }, { - "description": "Explicit operation timeout", + "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", "name": "timeout", "required": false, + "serverDefault": "30s", "type": { "kind": "instance_of", "type": { @@ -27935,7 +27963,7 @@ } } ], - "specLocation": "_global/put_script/PutScriptRequest.ts#L25-L42" + "specLocation": "_global/put_script/PutScriptRequest.ts#L25-L64" }, { "body": { @@ -29984,6 +30012,7 @@ }, "properties": [ { + "description": "Document that’s temporarily indexed in-memory and accessible from the script.", "name": "document", "required": true, "type": { @@ -29991,6 +30020,7 @@ } }, { + "description": "Index containing a mapping that’s compatible with the indexed document.\nYou may specify a remote index by prefixing the index with the remote cluster alias.", "name": "index", "required": true, "type": { @@ -30002,6 +30032,7 @@ } }, { + "description": "Use this parameter to specify a query for computing a score.", "name": "query", "required": true, "type": { @@ -30013,7 +30044,7 @@ } } ], - "specLocation": "_global/scripts_painless_execute/types.ts#L25-L29" + "specLocation": "_global/scripts_painless_execute/types.ts#L25-L39" }, { "attachedBehaviors": [ @@ -30023,8 +30054,10 @@ "kind": "properties", "properties": [ { + "description": "The context that the script should run in.", "name": "context", "required": false, + "serverDefault": "painless_test", "type": { "kind": "instance_of", "type": { @@ -30034,6 +30067,7 @@ } }, { + "description": "Additional parameters for the `context`.", "name": "context_setup", "required": false, "type": { @@ -30045,6 +30079,7 @@ } }, { + "description": "The Painless script to execute.", "name": "script", "required": false, "type": { @@ -30057,7 +30092,7 @@ } ] }, - "description": "Allows an arbitrary script to be executed and a result to be returned", + "description": "Runs a script and returns a result.", "inherits": { "type": { "name": "RequestBase", @@ -30071,7 +30106,7 @@ }, "path": [], "query": [], - "specLocation": "_global/scripts_painless_execute/ExecutePainlessScriptRequest.ts#L24-L35" + "specLocation": "_global/scripts_painless_execute/ExecutePainlessScriptRequest.ts#L24-L46" }, { "body": { @@ -38662,6 +38697,7 @@ "kind": "properties", "properties": [ { + "description": "The maximum number of documents to update.", "name": "max_docs", "required": false, "type": { @@ -38673,6 +38709,7 @@ } }, { + "description": "Specifies the documents to update using the Query DSL.", "name": "query", "required": false, "type": { @@ -38684,6 +38721,7 @@ } }, { + "description": "The script to run to update the document source or metadata when updating.", "name": "script", "required": false, "type": { @@ -38706,8 +38744,10 @@ } }, { + "description": "What to do if update by query hits version conflicts: `abort` or `proceed`.", "name": "conflicts", "required": false, + "serverDefault": "abort", "type": { "kind": "instance_of", "type": { @@ -38718,7 +38758,7 @@ } ] }, - "description": "Performs an update on every document in the index without changing the source,\nfor example to pick up a mapping change.", + "description": "Updates documents that match the specified query.\nIf no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes.", "inherits": { "type": { "name": "RequestBase", @@ -38732,7 +38772,7 @@ }, "path": [ { - "description": "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices", + "description": "Comma-separated list of data streams, indices, and aliases to search.\nSupports wildcards (`*`).\nTo search all data streams or indices, omit this parameter or use `*` or `_all`.", "name": "index", "required": true, "type": { @@ -38746,9 +38786,10 @@ ], "query": [ { - "description": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)", + "description": "If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices.\nThis behavior applies even if the request targets other open indices.\nFor example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`.", "name": "allow_no_indices", "required": false, + "serverDefault": true, "type": { "kind": "instance_of", "type": { @@ -38758,7 +38799,7 @@ } }, { - "description": "The analyzer to use for the query string", + "description": "Analyzer to use for the query string.", "name": "analyzer", "required": false, "type": { @@ -38770,9 +38811,10 @@ } }, { - "description": "Specify whether wildcard and prefix queries should be analyzed (default: false)", + "description": "If `true`, wildcard and prefix queries are analyzed.", "name": "analyze_wildcard", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -38782,9 +38824,10 @@ } }, { - "description": "What to do when the update by query hits version conflicts?", + "description": "What to do if update by query hits version conflicts: `abort` or `proceed`.", "name": "conflicts", "required": false, + "serverDefault": "abort", "type": { "kind": "instance_of", "type": { @@ -38794,9 +38837,10 @@ } }, { - "description": "The default operator for query string query (AND or OR)", + "description": "The default operator for query string query: `AND` or `OR`.", "name": "default_operator", "required": false, + "serverDefault": "OR", "type": { "kind": "instance_of", "type": { @@ -38806,7 +38850,7 @@ } }, { - "description": "The field to use as default where no field prefix is given in the query string", + "description": "Field to use as default where no field prefix is given in the query string.", "name": "df", "required": false, "type": { @@ -38818,7 +38862,7 @@ } }, { - "description": "Whether to expand wildcard expression to concrete indices that are open, closed or both.", + "description": "Type of index that wildcard patterns can match.\nIf the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.\nSupports comma-separated values, such as `open,hidden`.\nValid values are: `all`, `open`, `closed`, `hidden`, `none`.", "name": "expand_wildcards", "required": false, "type": { @@ -38842,9 +38886,10 @@ } }, { - "description": "Whether specified concrete indices should be ignored when unavailable (missing or closed)", + "description": "If `false`, the request returns an error if it targets a missing or closed index.", "name": "ignore_unavailable", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -38854,9 +38899,10 @@ } }, { - "description": "Specify whether format-based query failures (such as providing text to a numeric field) should be ignored", + "description": "If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.", "name": "lenient", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -38866,7 +38912,7 @@ } }, { - "description": "Maximum number of documents to process (default: all documents)", + "description": "Maximum number of documents to process.\nDefaults to all documents.", "name": "max_docs", "required": false, "type": { @@ -38878,7 +38924,7 @@ } }, { - "description": "Ingest pipeline to set on index requests made by this action. (default: none)", + "description": "ID of the pipeline to use to preprocess incoming documents.\nIf the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request.\nIf a final pipeline is configured it will always run, regardless of the value of this parameter.", "name": "pipeline", "required": false, "type": { @@ -38890,7 +38936,7 @@ } }, { - "description": "Specify the node or shard the operation should be performed on (default: random)", + "description": "Specifies the node or shard the operation should be performed on.\nRandom by default.", "name": "preference", "required": false, "type": { @@ -38902,9 +38948,10 @@ } }, { - "description": "Should the affected indexes be refreshed?", + "description": "If `true`, Elasticsearch refreshes affected shards to make the operation visible to search.", "name": "refresh", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -38914,7 +38961,7 @@ } }, { - "description": "Specify if request cache should be used for this request or not, defaults to index level setting", + "description": "If `true`, the request cache is used for this request.", "name": "request_cache", "required": false, "type": { @@ -38926,9 +38973,10 @@ } }, { - "description": "The throttle to set on this request in sub-requests per second. -1 means no throttle.", + "description": "The throttle for this request in sub-requests per second.", "name": "requests_per_second", "required": false, + "serverDefault": -1, "type": { "kind": "instance_of", "type": { @@ -38938,7 +38986,7 @@ } }, { - "description": "A comma-separated list of specific routing values", + "description": "Custom value used to route operations to a specific shard.", "name": "routing", "required": false, "type": { @@ -38950,7 +38998,7 @@ } }, { - "description": "Specify how long a consistent view of the index should be maintained for scrolled search", + "description": "Period to retain the search context for scrolling.", "name": "scroll", "required": false, "type": { @@ -38962,9 +39010,10 @@ } }, { - "description": "Size on the scroll request powering the update by query", + "description": "Size of the scroll request that powers the operation.", "name": "scroll_size", "required": false, + "serverDefault": 1000, "type": { "kind": "instance_of", "type": { @@ -38974,7 +39023,7 @@ } }, { - "description": "Explicit timeout for each search request. Defaults to no timeout.", + "description": "Explicit timeout for each search request.", "name": "search_timeout", "required": false, "type": { @@ -38986,7 +39035,7 @@ } }, { - "description": "Search operation type", + "description": "The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`.", "name": "search_type", "required": false, "type": { @@ -38998,9 +39047,10 @@ } }, { - "description": "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`.", + "description": "The number of slices this task should be divided into.", "name": "slices", "required": false, + "serverDefault": "1", "type": { "kind": "instance_of", "type": { @@ -39010,7 +39060,7 @@ } }, { - "description": "A comma-separated list of <field>:<direction> pairs", + "description": "A comma-separated list of <field>:<direction> pairs.", "name": "sort", "required": false, "type": { @@ -39025,7 +39075,7 @@ } }, { - "description": "Specific 'tag' of the request for logging and statistical purposes", + "description": "Specific `tag` of the request for logging and statistical purposes.", "name": "stats", "required": false, "type": { @@ -39040,7 +39090,7 @@ } }, { - "description": "The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.", + "description": "Maximum number of documents to collect for each shard.\nIf a query reaches this limit, Elasticsearch terminates the query early.\nElasticsearch collects documents before sorting.\nUse with caution.\nElasticsearch applies this parameter to each shard handling the request.\nWhen possible, let Elasticsearch perform early termination automatically.\nAvoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.", "name": "terminate_after", "required": false, "type": { @@ -39052,9 +39102,10 @@ } }, { - "description": "Time each individual bulk request should wait for shards that are unavailable.", + "description": "Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards.", "name": "timeout", "required": false, + "serverDefault": "1m", "type": { "kind": "instance_of", "type": { @@ -39064,7 +39115,7 @@ } }, { - "description": "Specify whether to return document version as part of a hit", + "description": "If `true`, returns the document version as part of a hit.", "name": "version", "required": false, "type": { @@ -39088,9 +39139,10 @@ } }, { - "description": "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)", + "description": "The number of shard copies that must be active before proceeding with the operation.\nSet to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).", "name": "wait_for_active_shards", "required": false, + "serverDefault": "1", "type": { "kind": "instance_of", "type": { @@ -39100,9 +39152,10 @@ } }, { - "description": "Should the request should block until the update by query operation is complete.", + "description": "If `true`, the request blocks until the operation is complete.", "name": "wait_for_completion", "required": false, + "serverDefault": true, "type": { "kind": "instance_of", "type": { @@ -39112,7 +39165,7 @@ } } ], - "specLocation": "_global/update_by_query/UpdateByQueryRequest.ts#L37-L85" + "specLocation": "_global/update_by_query/UpdateByQueryRequest.ts#L37-L218" }, { "body": { @@ -39354,7 +39407,7 @@ }, "path": [ { - "description": "The task id to rethrottle", + "description": "The ID for the task.", "name": "task_id", "required": true, "type": { @@ -39368,9 +39421,10 @@ ], "query": [ { - "description": "The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.", + "description": "The throttle for this request in sub-requests per second.", "name": "requests_per_second", "required": false, + "serverDefault": -1, "type": { "kind": "instance_of", "type": { @@ -39380,7 +39434,7 @@ } } ], - "specLocation": "_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts#L24-L35" + "specLocation": "_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts#L24-L42" }, { "body": { diff --git a/specification/_global/create/CreateRequest.ts b/specification/_global/create/CreateRequest.ts index 5bd38bfb65..31badee6d4 100644 --- a/specification/_global/create/CreateRequest.ts +++ b/specification/_global/create/CreateRequest.ts @@ -30,6 +30,8 @@ import { import { Duration } from '@_types/Time' /** + * Adds a JSON document to the specified data stream or index and makes it searchable. + * If the target is an index and the document already exists, the request updates the document and increments its version. * @rest_spec_name create * @availability stack since=5.0.0 stability=stable * @availability serverless stability=stable visibility=public @@ -37,18 +39,57 @@ import { Duration } from '@_types/Time' */ export interface Request<TDocument> extends RequestBase { path_parts: { + /** + * Unique identifier for the document. + */ id: Id + /** + * 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. + */ index: IndexName } query_parameters: { + /** + * 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. + */ pipeline?: string + /** + * 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`. + * @server_default false + */ refresh?: Refresh + /** + * Custom value used to route operations to a specific shard. + */ routing?: Routing + /** + * Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. + * @server_default 1m + */ timeout?: Duration + /** + * Explicit version number for concurrency control. + * The specified version must match the current version of the document for the request to succeed. + */ version?: VersionNumber + /** + * Specific version type: `external`, `external_gte`. + */ version_type?: VersionType + /** + * 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`). + * @server_default 1 + */ wait_for_active_shards?: WaitForActiveShards } - /** @codegen_name document */ + /** + * Request body contains the JSON source for the document data. + * @codegen_name document */ body?: TDocument } diff --git a/specification/_global/delete/DeleteRequest.ts b/specification/_global/delete/DeleteRequest.ts index 99980d4891..c311a6a29e 100644 --- a/specification/_global/delete/DeleteRequest.ts +++ b/specification/_global/delete/DeleteRequest.ts @@ -32,23 +32,60 @@ import { long } from '@_types/Numeric' import { Duration } from '@_types/Time' /** + * Removes a JSON document from the specified index. * @rest_spec_name delete * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=public */ export interface Request extends RequestBase { path_parts: { + /** + * Unique identifier for the document. + */ id: Id + /** + * Name of the target index. + */ index: IndexName } query_parameters: { + /** + * Only perform the operation if the document has this primary term. + */ if_primary_term?: long + /** + * Only perform the operation if the document has this sequence number. + */ if_seq_no?: SequenceNumber + /** + * 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`. + * @server_default false + */ refresh?: Refresh + /** + * Custom value used to route operations to a specific shard. + */ routing?: Routing + /** + * Period to wait for active shards. + * @server_default 1m + */ timeout?: Duration + /** + * Explicit version number for concurrency control. + * The specified version must match the current version of the document for the request to succeed. + */ version?: VersionNumber + /** + * Specific version type: `external`, `external_gte`. + */ version_type?: VersionType + /** + * 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`). + * @server_default 1 + */ wait_for_active_shards?: WaitForActiveShards } } diff --git a/specification/_global/delete_by_query/DeleteByQueryRequest.ts b/specification/_global/delete_by_query/DeleteByQueryRequest.ts index 7fda378c2b..69f1acb978 100644 --- a/specification/_global/delete_by_query/DeleteByQueryRequest.ts +++ b/specification/_global/delete_by_query/DeleteByQueryRequest.ts @@ -34,48 +34,176 @@ import { Duration } from '@_types/Time' import { Operator } from '@_types/query_dsl/Operator' /** + * Deletes documents that match the specified query. * @rest_spec_name delete_by_query * @availability stack since=5.0.0 stability=stable * @availability serverless stability=stable visibility=public */ export interface Request extends RequestBase { path_parts: { + /** + * Comma-separated 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`. + */ index: Indices } query_parameters: { + /** + * 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`. + * @server_default true + */ allow_no_indices?: boolean + /** + * Analyzer to use for the query string. + */ analyzer?: string + /** + * If `true`, wildcard and prefix queries are analyzed. + * @server_default false + */ analyze_wildcard?: boolean + /** + * What to do if delete by query hits version conflicts: `abort` or `proceed`. + * @server_default abort + */ conflicts?: Conflicts + /** + * The default operator for query string query: `AND` or `OR`. + * @server_default OR + */ default_operator?: Operator + /** + * Field to use as default where no field prefix is given in the query string. + */ df?: string + /** + * Type of index that wildcard patterns can match. + * If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + * Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * @server_default open + */ expand_wildcards?: ExpandWildcards from?: long + /** + * If `false`, the request returns an error if it targets a missing or closed index. + * @server_default false + */ ignore_unavailable?: boolean + /** + * If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + * @server_default false + */ lenient?: boolean + /** + * Maximum number of documents to process. + * Defaults to all documents. + */ max_docs?: long + /** + * Specifies the node or shard the operation should be performed on. + * Random by default. + */ preference?: string + /** + * If `true`, Elasticsearch refreshes all shards involved in the delete by query after the request completes. + * @server_default false + */ refresh?: boolean + /** + * If `true`, the request cache is used for this request. + * Defaults to the index-level setting. + */ request_cache?: boolean + /** + * The throttle for this request in sub-requests per second. + */ requests_per_second?: float + /** + * Custom value used to route operations to a specific shard. + */ routing?: Routing + /** + * Query in the Lucene query string syntax. + */ q?: string + /** + * Period to retain the search context for scrolling. + */ scroll?: Duration + /** + * Size of the scroll request that powers the operation. + * @server_default 1000 + */ scroll_size?: long + /** + * Explicit timeout for each search request. + * Defaults to no timeout. + */ search_timeout?: Duration + /** + * The type of the search operation. + * Available options: `query_then_fetch`, `dfs_query_then_fetch`. + */ search_type?: SearchType + /** + * The number of slices this task should be divided into. + * @server_default 1 + */ slices?: Slices + /** + * A comma-separated list of <field>:<direction> pairs. + */ sort?: string[] + /** + * Specific `tag` of the request for logging and statistical purposes. + */ stats?: string[] + /** + * 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. + */ terminate_after?: long + /** + * Period each deletion request waits for active shards. + * @server_default 1m + */ timeout?: Duration + /** + * If `true`, returns the document version as part of a hit. + */ version?: boolean + /** + * 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`). + * @server_default 1 + */ wait_for_active_shards?: WaitForActiveShards + /** + * If `true`, the request blocks until the operation is complete. + * @server_default true + */ wait_for_completion?: boolean } body: { + /** + * The maximum number of documents to delete. + */ max_docs?: long + /** + * Specifies the documents to delete using the Query DSL. + */ query?: QueryContainer + /** + * Slice the request manually using the provided slice ID and total number of slices. + */ slice?: SlicedScroll } } diff --git a/specification/_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts b/specification/_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts index 3056fba4b7..02b19d417e 100644 --- a/specification/_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts +++ b/specification/_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts @@ -27,9 +27,15 @@ import { float } from '@_types/Numeric' */ export interface Request extends RequestBase { path_parts: { + /** + * The ID for the task. + */ task_id: TaskId } query_parameters: { + /** + * The throttle for this request in sub-requests per second. + */ requests_per_second?: float } } diff --git a/specification/_global/delete_script/DeleteScriptRequest.ts b/specification/_global/delete_script/DeleteScriptRequest.ts index 904b8dc4c0..63b4e94185 100644 --- a/specification/_global/delete_script/DeleteScriptRequest.ts +++ b/specification/_global/delete_script/DeleteScriptRequest.ts @@ -22,16 +22,30 @@ import { Id } from '@_types/common' import { Duration } from '@_types/Time' /** + * Deletes a stored script or search template. * @rest_spec_name delete_script * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=public */ export interface Request extends RequestBase { path_parts: { + /** + * Identifier for the stored script or search template. + */ id: Id } query_parameters: { + /** + * 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. + * @server_default 30s + */ master_timeout?: Duration + /** + * Period to wait for a response. + * If no response is received before the timeout expires, the request fails and returns an error. + * @server_default 30s + */ timeout?: Duration } } diff --git a/specification/_global/get_script/GetScriptRequest.ts b/specification/_global/get_script/GetScriptRequest.ts index 60ad0dc7ba..3f4010ab94 100644 --- a/specification/_global/get_script/GetScriptRequest.ts +++ b/specification/_global/get_script/GetScriptRequest.ts @@ -22,12 +22,16 @@ import { Id } from '@_types/common' import { Duration } from '@_types/Time' /** + * Retrieves a stored script or search template. * @rest_spec_name get_script * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=public */ export interface Request extends RequestBase { path_parts: { + /** + * Identifier for the stored script or search template. + */ id: Id } query_parameters: { diff --git a/specification/_global/open_point_in_time/OpenPointInTimeRequest.ts b/specification/_global/open_point_in_time/OpenPointInTimeRequest.ts index 42f5643651..20a2123f28 100644 --- a/specification/_global/open_point_in_time/OpenPointInTimeRequest.ts +++ b/specification/_global/open_point_in_time/OpenPointInTimeRequest.ts @@ -39,10 +39,30 @@ export interface Request extends RequestBase { index: Indices } query_parameters: { + /** + * Extends the time to live of the corresponding point in time. + */ keep_alive: Duration + /** + * If `false`, the request returns an error if it targets a missing or closed index. + * @server_default false + */ ignore_unavailable?: boolean + /** + * Specifies the node or shard the operation should be performed on. + * Random by default. + */ preference?: string + /** + * Custom value used to route operations to a specific shard. + */ routing?: Routing + /** + * Type of index that wildcard patterns can match. + * If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + * Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + * @server_default open + */ expand_wildcards?: ExpandWildcards } } diff --git a/specification/_global/put_script/PutScriptRequest.ts b/specification/_global/put_script/PutScriptRequest.ts index 8f5b804c24..e1bf89bc60 100644 --- a/specification/_global/put_script/PutScriptRequest.ts +++ b/specification/_global/put_script/PutScriptRequest.ts @@ -23,20 +23,42 @@ import { StoredScript } from '@_types/Scripting' import { Duration } from '@_types/Time' /** + * Creates or updates a stored script or search template. * @rest_spec_name put_script * @availability stack since=0.0.0 stability=stable * @availability serverless stability=stable visibility=public */ export interface Request extends RequestBase { path_parts: { + /** + * Identifier for the stored script or search template. + * Must be unique within the cluster. + */ id: Id + /** + * Context in which the script or search template should run. + * To prevent errors, the API immediately compiles the script or template in this context. + */ context?: Name } query_parameters: { + /** + * 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. + * @server_default 30s + */ master_timeout?: Duration + /** + * Period to wait for a response. + * If no response is received before the timeout expires, the request fails and returns an error. + * @server_default 30s + */ timeout?: Duration } body: { + /** + * Contains the script or search template, its parameters, and its language. + */ script: StoredScript } } diff --git a/specification/_global/scripts_painless_execute/ExecutePainlessScriptRequest.ts b/specification/_global/scripts_painless_execute/ExecutePainlessScriptRequest.ts index e7c9605851..eafd1613d2 100644 --- a/specification/_global/scripts_painless_execute/ExecutePainlessScriptRequest.ts +++ b/specification/_global/scripts_painless_execute/ExecutePainlessScriptRequest.ts @@ -22,14 +22,25 @@ import { InlineScript } from '@_types/Scripting' import { PainlessContextSetup } from './types' /** + * Runs a script and returns a result. * @rest_spec_name scripts_painless_execute * @availability stack since=6.3.0 stability=experimental * @availability serverless stability=experimental visibility=public */ export interface Request extends RequestBase { body: { + /** + * The context that the script should run in. + * @server_default painless_test + */ context?: string + /** + * Additional parameters for the `context`. + */ context_setup?: PainlessContextSetup + /** + * The Painless script to execute. + */ script?: InlineScript } } diff --git a/specification/_global/scripts_painless_execute/types.ts b/specification/_global/scripts_painless_execute/types.ts index 8e861909fa..87a6c4df78 100644 --- a/specification/_global/scripts_painless_execute/types.ts +++ b/specification/_global/scripts_painless_execute/types.ts @@ -23,8 +23,18 @@ import { integer } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' export class PainlessContextSetup { + /** + * Document that’s temporarily indexed in-memory and accessible from the script. + */ document: UserDefinedValue + /** + * Index containing a mapping that’s compatible with the indexed document. + * You may specify a remote index by prefixing the index with the remote cluster alias. + */ index: IndexName + /** + * Use this parameter to specify a query for computing a score. + */ query: QueryContainer } diff --git a/specification/_global/update_by_query/UpdateByQueryRequest.ts b/specification/_global/update_by_query/UpdateByQueryRequest.ts index e37d645920..4faa5db109 100644 --- a/specification/_global/update_by_query/UpdateByQueryRequest.ts +++ b/specification/_global/update_by_query/UpdateByQueryRequest.ts @@ -35,51 +35,187 @@ import { Duration } from '@_types/Time' import { Operator } from '@_types/query_dsl/Operator' /** + * Updates documents that match the specified query. + * If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes. * @rest_spec_name update_by_query * @availability stack since=2.4.0 stability=stable * @availability serverless stability=stable visibility=public */ export interface Request extends RequestBase { path_parts: { + /** + * Comma-separated 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`. + */ index: Indices } query_parameters: { + /** + * 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`. + * @server_default true + */ allow_no_indices?: boolean + /** + * Analyzer to use for the query string. + */ analyzer?: string + /** + * If `true`, wildcard and prefix queries are analyzed. + * @server_default false + */ analyze_wildcard?: boolean + /** + * What to do if update by query hits version conflicts: `abort` or `proceed`. + * @server_default abort + */ conflicts?: Conflicts + /** + * The default operator for query string query: `AND` or `OR`. + * @server_default OR + */ default_operator?: Operator + /** + * Field to use as default where no field prefix is given in the query string. + */ df?: string + /** + * Type of index that wildcard patterns can match. + * If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + * Supports comma-separated values, such as `open,hidden`. + * Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + */ expand_wildcards?: ExpandWildcards from?: long + /** + * If `false`, the request returns an error if it targets a missing or closed index. + * @server_default false + */ ignore_unavailable?: boolean + /** + * If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + * @server_default false + */ lenient?: boolean + /** + * Maximum number of documents to process. + * Defaults to all documents. + */ max_docs?: long + /** + * 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. + */ pipeline?: string + /** + * Specifies the node or shard the operation should be performed on. + * Random by default. + */ preference?: string + /** + * If `true`, Elasticsearch refreshes affected shards to make the operation visible to search. + * @server_default false + */ refresh?: boolean + /** + * If `true`, the request cache is used for this request. + */ request_cache?: boolean + /** + * The throttle for this request in sub-requests per second. + * @server_default -1 + */ requests_per_second?: float + /** + * Custom value used to route operations to a specific shard. + */ routing?: Routing + /** + * Period to retain the search context for scrolling. + */ scroll?: Duration + /** + * Size of the scroll request that powers the operation. + * @server_default 1000 + */ scroll_size?: long + /** + * Explicit timeout for each search request. + */ search_timeout?: Duration + /** + * The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`. + */ search_type?: SearchType + /** + * The number of slices this task should be divided into. + * @server_default 1 + */ slices?: Slices + /** + * A comma-separated list of <field>:<direction> pairs. + */ sort?: string[] + /** + * Specific `tag` of the request for logging and statistical purposes. + */ stats?: string[] + /** + * 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. + */ terminate_after?: long + /** + * Period each update request waits for the following operations: dynamic mapping updates, waiting for active shards. + * @server_default 1m + */ timeout?: Duration + /** + * If `true`, returns the document version as part of a hit. + */ version?: boolean version_type?: boolean + /** + * 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`). + * @server_default 1 + */ wait_for_active_shards?: WaitForActiveShards + /** + * If `true`, the request blocks until the operation is complete. + * @server_default true + */ wait_for_completion?: boolean } body: { + /** + * The maximum number of documents to update. + */ max_docs?: long + /** + * Specifies the documents to update using the Query DSL. + */ query?: QueryContainer + /** + * The script to run to update the document source or metadata when updating. + */ script?: Script + /** + * Slice the request manually using the provided slice ID and total number of slices. + */ slice?: SlicedScroll + /** + * What to do if update by query hits version conflicts: `abort` or `proceed`. + * @server_default abort + */ conflicts?: Conflicts } } diff --git a/specification/_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts b/specification/_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts index 3024820cc8..556c055bbf 100644 --- a/specification/_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts +++ b/specification/_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts @@ -27,9 +27,16 @@ import { float, long } from '@_types/Numeric' */ export interface Request extends RequestBase { path_parts: { + /** + * The ID for the task. + */ task_id: Id } query_parameters: { + /** + * The throttle for this request in sub-requests per second. + * @server_default -1 + */ requests_per_second?: float } }