From 7c6e5988e7ce0fa7b7c56c2f2e789b45abbf67d2 Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 20 Nov 2024 12:29:32 +0200 Subject: [PATCH] Adding allow_partial_search_results parameter to OpenPointInTime action (#3155) (cherry picked from commit db4203b0f43d40a0eab607f1b504a3f1cec751d2) --- output/openapi/elasticsearch-openapi.json | 10 ++++++++++ .../openapi/elasticsearch-serverless-openapi.json | 10 ++++++++++ output/schema/schema-serverless.json | 15 ++++++++++++++- output/schema/schema.json | 15 ++++++++++++++- output/typescript/types.ts | 1 + .../open_point_in_time/OpenPointInTimeRequest.ts | 6 ++++++ specification/_json_spec/open_point_in_time.json | 4 ++++ 7 files changed, 59 insertions(+), 2 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 22964c672d..ccf4acdcdb 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -23761,6 +23761,16 @@ "$ref": "#/components/schemas/_types:ExpandWildcards" }, "style": "form" + }, + { + "in": "query", + "name": "allow_partial_search_results", + "description": "If `false`, creating a point in time request when a shard is missing or unavailable will throw an exception.\nIf `true`, the point in time will contain all the shards that are available at the time of the request.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" } ], "requestBody": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index dee416b4c4..d7e293e9a1 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -14586,6 +14586,16 @@ "$ref": "#/components/schemas/_types:ExpandWildcards" }, "style": "form" + }, + { + "in": "query", + "name": "allow_partial_search_results", + "description": "If `false`, creating a point in time request when a shard is missing or unavailable will throw an exception.\nIf `true`, the point in time will contain all the shards that are available at the time of the request.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" } ], "requestBody": { diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index b860896026..db10c84148 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -34664,9 +34664,22 @@ "namespace": "_types" } } + }, + { + "description": "If `false`, creating a point in time request when a shard is missing or unavailable will throw an exception.\nIf `true`, the point in time will contain all the shards that are available at the time of the request.", + "name": "allow_partial_search_results", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "_global/open_point_in_time/OpenPointInTimeRequest.ts#L25-L81" + "specLocation": "_global/open_point_in_time/OpenPointInTimeRequest.ts#L25-L87" }, { "body": { diff --git a/output/schema/schema.json b/output/schema/schema.json index fbce0ea9d1..71c6f98ea9 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -29567,9 +29567,22 @@ "namespace": "_types" } } + }, + { + "description": "If `false`, creating a point in time request when a shard is missing or unavailable will throw an exception.\nIf `true`, the point in time will contain all the shards that are available at the time of the request.", + "name": "allow_partial_search_results", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "_global/open_point_in_time/OpenPointInTimeRequest.ts#L25-L81" + "specLocation": "_global/open_point_in_time/OpenPointInTimeRequest.ts#L25-L87" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3cbd479c40..3eaaeb438e 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -895,6 +895,7 @@ export interface OpenPointInTimeRequest extends RequestBase { preference?: string routing?: Routing expand_wildcards?: ExpandWildcards + allow_partial_search_results?: boolean body?: { index_filter?: QueryDslQueryContainer } diff --git a/specification/_global/open_point_in_time/OpenPointInTimeRequest.ts b/specification/_global/open_point_in_time/OpenPointInTimeRequest.ts index 8b1da5da5e..cc4b86d567 100644 --- a/specification/_global/open_point_in_time/OpenPointInTimeRequest.ts +++ b/specification/_global/open_point_in_time/OpenPointInTimeRequest.ts @@ -71,6 +71,12 @@ export interface Request extends RequestBase { * @server_default open */ expand_wildcards?: ExpandWildcards + /** + * If `false`, creating a point in time request when a shard is missing or unavailable will throw an exception. + * If `true`, the point in time will contain all the shards that are available at the time of the request. + * @server_default false + */ + allow_partial_search_results?: boolean } body: { /** diff --git a/specification/_json_spec/open_point_in_time.json b/specification/_json_spec/open_point_in_time.json index 34e9f4a4b6..3870c1f95f 100644 --- a/specification/_json_spec/open_point_in_time.json +++ b/specification/_json_spec/open_point_in_time.json @@ -47,6 +47,10 @@ "type": "string", "description": "Specific the time to live for the point in time", "required": true + }, + "allow_partial_search_results": { + "type": "boolean", + "description": "Specify whether to tolerate shards missing when creating the point-in-time, or otherwise throw an exception. (default: false)" } }, "body": {