From 79cf17d1bebbc829271cd4d9b6d081672f752f87 Mon Sep 17 00:00:00 2001 From: pquentin <42327+pquentin@users.noreply.github.com> Date: Sat, 30 Nov 2024 04:06:16 +0000 Subject: [PATCH 1/2] Update rest-api-spec --- output/schema/validation-errors.json | 2 ++ specification/_json_spec/async_search.submit.json | 10 ---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 041f98de05..fb6e9bbfa9 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -51,6 +51,8 @@ }, "async_search.submit": { "request": [ + "Request: query parameter 'keep_alive' does not exist in the json spec", + "Request: query parameter 'pre_filter_shard_size' does not exist in the json spec", "interface definition _types:QueryVectorBuilder - Property text_embedding is a single-variant and must be required", "type_alias definition _spec_utils:PipeSeparatedFlags / union_of / instance_of - No type definition for '_spec_utils.PipeSeparatedFlags:T'" ], diff --git a/specification/_json_spec/async_search.submit.json b/specification/_json_spec/async_search.submit.json index 628a79a4e9..2d5ad25831 100644 --- a/specification/_json_spec/async_search.submit.json +++ b/specification/_json_spec/async_search.submit.json @@ -39,11 +39,6 @@ "description": "Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false)", "default": false }, - "keep_alive": { - "type": "time", - "description": "Update the time interval in which the results (partial or final) for this search will be available", - "default": "5d" - }, "batched_reduce_size": { "type": "number", "description": "The number of shard results that should be reduced at once on the coordinating node. This value should be used as the granularity at which progress results will be made available.", @@ -118,11 +113,6 @@ "type": "string", "description": "Specify the node or shard the operation should be performed on (default: random)" }, - "pre_filter_shard_size": { - "type": "number", - "default": 1, - "description": "Cannot be changed: this is to enforce the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped." - }, "rest_total_hits_as_int": { "type": "boolean", "description": "Indicates whether hits.total should be rendered as an integer or an object in the rest search response", From a559d44e2de577bb5f248b02fddc29e87fe41caa Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 2 Dec 2024 14:32:06 +0400 Subject: [PATCH 2/2] Remove two rejected parameters from async_search.submit --- output/openapi/elasticsearch-openapi.json | 32 ------------------- .../elasticsearch-serverless-openapi.json | 32 ------------------- output/schema/schema-serverless.json | 28 +--------------- output/schema/schema.json | 28 +--------------- output/schema/validation-errors.json | 2 -- output/typescript/types.ts | 2 -- .../submit/AsyncSearchSubmitRequest.ts | 15 ++------- 7 files changed, 4 insertions(+), 135 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 3087b5fdf4..68498e0257 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -170,9 +170,6 @@ { "$ref": "#/components/parameters/async_search.submit#keep_on_completion" }, - { - "$ref": "#/components/parameters/async_search.submit#keep_alive" - }, { "$ref": "#/components/parameters/async_search.submit#allow_no_indices" }, @@ -221,9 +218,6 @@ { "$ref": "#/components/parameters/async_search.submit#preference" }, - { - "$ref": "#/components/parameters/async_search.submit#pre_filter_shard_size" - }, { "$ref": "#/components/parameters/async_search.submit#request_cache" }, @@ -326,9 +320,6 @@ { "$ref": "#/components/parameters/async_search.submit#keep_on_completion" }, - { - "$ref": "#/components/parameters/async_search.submit#keep_alive" - }, { "$ref": "#/components/parameters/async_search.submit#allow_no_indices" }, @@ -377,9 +368,6 @@ { "$ref": "#/components/parameters/async_search.submit#preference" }, - { - "$ref": "#/components/parameters/async_search.submit#pre_filter_shard_size" - }, { "$ref": "#/components/parameters/async_search.submit#request_cache" }, @@ -92694,16 +92682,6 @@ }, "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#allow_no_indices": { "in": "query", "name": "allow_no_indices", @@ -92864,16 +92842,6 @@ }, "style": "form" }, - "async_search.submit#pre_filter_shard_size": { - "in": "query", - "name": "pre_filter_shard_size", - "description": "The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped.", - "deprecated": false, - "schema": { - "type": "number" - }, - "style": "form" - }, "async_search.submit#request_cache": { "in": "query", "name": "request_cache", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index d907d66327..2f460e5736 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -170,9 +170,6 @@ { "$ref": "#/components/parameters/async_search.submit#keep_on_completion" }, - { - "$ref": "#/components/parameters/async_search.submit#keep_alive" - }, { "$ref": "#/components/parameters/async_search.submit#allow_no_indices" }, @@ -221,9 +218,6 @@ { "$ref": "#/components/parameters/async_search.submit#preference" }, - { - "$ref": "#/components/parameters/async_search.submit#pre_filter_shard_size" - }, { "$ref": "#/components/parameters/async_search.submit#request_cache" }, @@ -326,9 +320,6 @@ { "$ref": "#/components/parameters/async_search.submit#keep_on_completion" }, - { - "$ref": "#/components/parameters/async_search.submit#keep_alive" - }, { "$ref": "#/components/parameters/async_search.submit#allow_no_indices" }, @@ -377,9 +368,6 @@ { "$ref": "#/components/parameters/async_search.submit#preference" }, - { - "$ref": "#/components/parameters/async_search.submit#pre_filter_shard_size" - }, { "$ref": "#/components/parameters/async_search.submit#request_cache" }, @@ -56840,16 +56828,6 @@ }, "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#allow_no_indices": { "in": "query", "name": "allow_no_indices", @@ -57010,16 +56988,6 @@ }, "style": "form" }, - "async_search.submit#pre_filter_shard_size": { - "in": "query", - "name": "pre_filter_shard_size", - "description": "The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped.", - "deprecated": false, - "schema": { - "type": "number" - }, - "style": "form" - }, "async_search.submit#request_cache": { "in": "query", "name": "request_cache", diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index f0582e5320..135199d4d7 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -10698,19 +10698,6 @@ } } }, - { - "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": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)", "name": "allow_no_indices", @@ -10905,19 +10892,6 @@ } } }, - { - "description": "The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped.", - "name": "pre_filter_shard_size", - "required": false, - "serverDefault": 1, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, { "description": "Specify if request cache should be used for this request or not, defaults to true", "name": "request_cache", @@ -11226,7 +11200,7 @@ } } ], - "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L54-L289" + "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L54-L278" }, { "body": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 7fa7b55def..04c7b94a24 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -88242,19 +88242,6 @@ } } }, - { - "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": "Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)", "name": "allow_no_indices", @@ -88449,19 +88436,6 @@ } } }, - { - "description": "The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped.", - "name": "pre_filter_shard_size", - "required": false, - "serverDefault": 1, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, { "description": "Specify if request cache should be used for this request or not, defaults to true", "name": "request_cache", @@ -88770,7 +88744,7 @@ } } ], - "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L54-L289" + "specLocation": "async_search/submit/AsyncSearchSubmitRequest.ts#L54-L278" }, { "kind": "response", diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index fb6e9bbfa9..041f98de05 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -51,8 +51,6 @@ }, "async_search.submit": { "request": [ - "Request: query parameter 'keep_alive' does not exist in the json spec", - "Request: query parameter 'pre_filter_shard_size' does not exist in the json spec", "interface definition _types:QueryVectorBuilder - Property text_embedding is a single-variant and must be required", "type_alias definition _spec_utils:PipeSeparatedFlags / union_of / instance_of - No type definition for '_spec_utils.PipeSeparatedFlags:T'" ], diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 8b06c657ad..41b3752448 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -6762,7 +6762,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase { index?: Indices wait_for_completion_timeout?: Duration keep_on_completion?: boolean - keep_alive?: Duration allow_no_indices?: boolean allow_partial_search_results?: boolean analyzer?: string @@ -6779,7 +6778,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase { lenient?: boolean max_concurrent_shard_requests?: long preference?: string - pre_filter_shard_size?: long request_cache?: boolean routing?: Routing search_type?: SearchType diff --git a/specification/async_search/submit/AsyncSearchSubmitRequest.ts b/specification/async_search/submit/AsyncSearchSubmitRequest.ts index 6154bcfbb8..f1d59c9300 100644 --- a/specification/async_search/submit/AsyncSearchSubmitRequest.ts +++ b/specification/async_search/submit/AsyncSearchSubmitRequest.ts @@ -67,8 +67,8 @@ import { Duration } from '@_types/Time' * @doc_tag search */ // NOTE: this is a SearchRequest with: -// * 3 added parameters: wait_for_completion_timeout, keep_on_completion and keep_alive -// * 1 removed parameters: scroll +// * 2 added parameters: wait_for_completion_timeout, keep_on_completion +// * 2 removed parameters: scroll, pre_filter_shard_size export interface Request extends RequestBase { path_parts: { index?: Indices @@ -85,12 +85,6 @@ export interface Request extends RequestBase { * @server_default false */ keep_on_completion?: boolean - /** - * 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 allow_no_indices?: boolean allow_partial_search_results?: boolean analyzer?: string @@ -116,11 +110,6 @@ export interface Request extends RequestBase { lenient?: boolean max_concurrent_shard_requests?: long preference?: string - /** - * The default value cannot be changed, which enforces the execution of a pre-filter roundtrip to retrieve statistics from each shard so that the ones that surely don’t hold any document matching the query get skipped. - * @server_default 1 - */ - pre_filter_shard_size?: long /** @server_default true */ request_cache?: boolean routing?: Routing