From f00997cd5fa70a22a1128c1e8bbf6552fdcf3ca9 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 24 Jan 2025 15:01:03 +0400 Subject: [PATCH] Add back keep_alive to async_search.submit (#3601) (cherry picked from commit c3c2156ab2f5289322177c626c5264157c03dc47) # Conflicts: # output/schema/schema-serverless.json # output/schema/schema.json # output/schema/validation-errors.json --- output/openapi/elasticsearch-openapi.json | 16 ++++++++++++++++ .../elasticsearch-serverless-openapi.json | 16 ++++++++++++++++ output/schema/schema-serverless.json | 15 ++++++++++++++- output/schema/schema.json | 15 ++++++++++++++- output/schema/validation-errors.json | 1 + output/typescript/types.ts | 1 + .../submit/AsyncSearchSubmitRequest.ts | 8 +++++++- 7 files changed, 69 insertions(+), 3 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index d20eaed277..ce2529da5d 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -167,6 +167,9 @@ { "$ref": "#/components/parameters/async_search.submit#wait_for_completion_timeout" }, + { + "$ref": "#/components/parameters/async_search.submit#keep_alive" + }, { "$ref": "#/components/parameters/async_search.submit#keep_on_completion" }, @@ -320,6 +323,9 @@ { "$ref": "#/components/parameters/async_search.submit#wait_for_completion_timeout" }, + { + "$ref": "#/components/parameters/async_search.submit#keep_alive" + }, { "$ref": "#/components/parameters/async_search.submit#keep_on_completion" }, @@ -98233,6 +98239,16 @@ }, "style": "form" }, + "async_search.submit#keep_alive": { + "in": "query", + "name": "keep_alive", + "description": "Specifies how long the async search needs to be available.\nOngoing async searches and any saved search results are deleted after this period.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Duration" + }, + "style": "form" + }, "async_search.submit#keep_on_completion": { "in": "query", "name": "keep_on_completion", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index d9a6af5cb2..3f8941b4d7 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -167,6 +167,9 @@ { "$ref": "#/components/parameters/async_search.submit#wait_for_completion_timeout" }, + { + "$ref": "#/components/parameters/async_search.submit#keep_alive" + }, { "$ref": "#/components/parameters/async_search.submit#keep_on_completion" }, @@ -320,6 +323,9 @@ { "$ref": "#/components/parameters/async_search.submit#wait_for_completion_timeout" }, + { + "$ref": "#/components/parameters/async_search.submit#keep_alive" + }, { "$ref": "#/components/parameters/async_search.submit#keep_on_completion" }, @@ -58053,6 +58059,16 @@ }, "style": "form" }, + "async_search.submit#keep_alive": { + "in": "query", + "name": "keep_alive", + "description": "Specifies how long the async search needs to be available.\nOngoing async searches and any saved search results are deleted after this period.", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Duration" + }, + "style": "form" + }, "async_search.submit#keep_on_completion": { "in": "query", "name": "keep_on_completion", diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 76b7ce5876..9108ea781d 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -11253,6 +11253,19 @@ } } }, + { + "description": "Specifies how long the async search needs to be available.\nOngoing async searches and any saved search results are deleted after this period.", + "name": "keep_alive", + "required": false, + "serverDefault": "5d", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, { "description": "If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.", "name": "keep_on_completion", @@ -11779,7 +11792,7 @@ } } ], - "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L55-L290" + "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L55-L296" }, { "body": { diff --git a/output/schema/schema.json b/output/schema/schema.json index f9e5a64883..4fdb4ae497 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -90858,6 +90858,19 @@ } } }, + { + "description": "Specifies how long the async search needs to be available.\nOngoing async searches and any saved search results are deleted after this period.", + "name": "keep_alive", + "required": false, + "serverDefault": "5d", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, { "description": "If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.", "name": "keep_on_completion", @@ -91384,7 +91397,7 @@ } } ], - "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L55-L290" + "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L55-L296" }, { "kind": "response", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 81f17e62d6..60027f1985 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -2,6 +2,7 @@ "endpointErrors": { "async_search.submit": { "request": [ + "Request: query parameter 'keep_alive' does not exist in the json spec", "Request: query parameter 'min_compatible_shard_node' does not exist in the json spec", "interface definition _types:QueryVectorBuilder - Property text_embedding is a single-variant and must be required" ], diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 770e87154c..85d0e0a43c 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -6789,6 +6789,7 @@ export interface AsyncSearchStatusStatusResponseBase extends AsyncSearchAsyncSea export interface AsyncSearchSubmitRequest extends RequestBase { index?: Indices wait_for_completion_timeout?: Duration + keep_alive?: Duration keep_on_completion?: boolean allow_no_indices?: boolean allow_partial_search_results?: boolean diff --git a/specification/async_search/submit/AsyncSearchSubmitRequest.ts b/specification/async_search/submit/AsyncSearchSubmitRequest.ts index d4282669ba..a276f35c0b 100644 --- a/specification/async_search/submit/AsyncSearchSubmitRequest.ts +++ b/specification/async_search/submit/AsyncSearchSubmitRequest.ts @@ -68,7 +68,7 @@ import { Duration } from '@_types/Time' * @doc_tag search */ // NOTE: this is a SearchRequest with: -// * 2 added parameters: wait_for_completion_timeout, keep_on_completion +// * 2 added parameters: wait_for_completion_timeout, keep_on_completion and keep_alive // * 2 removed parameters: scroll, pre_filter_shard_size export interface Request extends RequestBase { urls: [ @@ -91,6 +91,12 @@ export interface Request extends RequestBase { * @server_default 1s */ wait_for_completion_timeout?: Duration + /** + * Specifies how long the async search needs to be available. + * Ongoing async searches and any saved search results are deleted after this period. + * @server_default 5d + */ + keep_alive?: Duration /** * If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`. * @server_default false