From fb1e32578f8c1075e2bfa172a235994f01a029a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:45:57 +0400 Subject: [PATCH] [Backport 8.12] Add force_synthethic_source parameter (#2483) (cherry picked from commit bda8a6d16e9b4b83fa44cf6f4d98af059b7ce0dc) Co-authored-by: Quentin Pradet --- output/schema/schema.json | 66 ++++++++++++++++++- output/schema/validation-errors.json | 11 +--- output/typescript/types.ts | 3 + specification/_global/get/GetRequest.ts | 7 ++ specification/_global/mget/MultiGetRequest.ts | 7 ++ specification/_global/search/SearchRequest.ts | 7 ++ 6 files changed, 88 insertions(+), 13 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 9f17b2c46b..8083e9a9c3 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -23419,6 +23419,26 @@ } ], "query": [ + { + "availability": { + "stack": { + "featureFlag": "es.index_mode_feature_flag_registered", + "since": "8.4.0", + "visibility": "feature_flag" + } + }, + "description": "Should this request force synthetic _source?\nUse this to test if the mapping supports synthetic _source and to get a sense of the worst case performance.\nFetches with this enabled will be slower the enabling synthetic source natively in the index.", + "name": "force_synthetic_source", + "required": false, + "since": "8.4.0", + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "description": "Specifies the node or shard the operation should be performed on. Random by default.", "name": "preference", @@ -23546,7 +23566,7 @@ } } ], - "specLocation": "_global/get/GetRequest.ts#L31-L91" + "specLocation": "_global/get/GetRequest.ts#L31-L98" }, { "body": { @@ -26310,6 +26330,26 @@ } ], "query": [ + { + "availability": { + "stack": { + "featureFlag": "es.index_mode_feature_flag_registered", + "since": "8.4.0", + "visibility": "feature_flag" + } + }, + "description": "Should this request force synthetic _source?\nUse this to test if the mapping supports synthetic _source and to get a sense of the worst case performance.\nFetches with this enabled will be slower the enabling synthetic source natively in the index.", + "name": "force_synthetic_source", + "required": false, + "since": "8.4.0", + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "description": "Specifies the node or shard the operation should be performed on. Random by default.", "name": "preference", @@ -26416,7 +26456,7 @@ } } ], - "specLocation": "_global/mget/MultiGetRequest.ts#L25-L91" + "specLocation": "_global/mget/MultiGetRequest.ts#L25-L98" }, { "body": { @@ -31962,9 +32002,29 @@ ], "kind": "union_of" } + }, + { + "availability": { + "stack": { + "featureFlag": "es.index_mode_feature_flag_registered", + "since": "8.4.0", + "visibility": "feature_flag" + } + }, + "description": "Should this request force synthetic _source?\nUse this to test if the mapping supports synthetic _source and to get a sense of the worst case performance.\nFetches with this enabled will be slower the enabling synthetic source natively in the index.", + "name": "force_synthetic_source", + "required": false, + "since": "8.4.0", + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ], - "specLocation": "_global/search/SearchRequest.ts#L53-L506" + "specLocation": "_global/search/SearchRequest.ts#L53-L513" }, { "body": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 6aea699417..d8183e5aab 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -650,12 +650,6 @@ ], "response": [] }, - "get": { - "request": [ - "Request: missing json spec query parameter 'force_synthetic_source'" - ], - "response": [] - }, "get_source": { "request": [ "Request: query parameter 'stored_fields' does not exist in the json spec" @@ -929,9 +923,7 @@ "response": [] }, "mget": { - "request": [ - "Request: missing json spec query parameter 'force_synthetic_source'" - ], + "request": [], "response": [ "type_alias definition _global.mget:ResponseItem / union_of / instance_of / Generics / instance_of - No type definition for '_global.mget:TDocument'" ] @@ -1171,7 +1163,6 @@ }, "search": { "request": [ - "Request: missing json spec query parameter 'force_synthetic_source'", "Request: missing json spec query parameter 'include_named_queries_score'", "interface definition _types:RankContainer - Property rrf is a single-variant and must be required" ], diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3c2060a3ea..b9d32a04d6 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -376,6 +376,7 @@ export interface GetGetResult { export interface GetRequest extends RequestBase { id: Id index: IndexName + force_synthetic_source?: boolean preference?: string realtime?: boolean refresh?: boolean @@ -691,6 +692,7 @@ export interface MgetOperation { export interface MgetRequest extends RequestBase { index?: IndexName + force_synthetic_source?: boolean preference?: string realtime?: boolean refresh?: boolean @@ -1184,6 +1186,7 @@ export interface SearchRequest extends RequestBase { size?: integer from?: integer sort?: string | string[] + force_synthetic_source?: boolean body?: { aggregations?: Record aggs?: Record diff --git a/specification/_global/get/GetRequest.ts b/specification/_global/get/GetRequest.ts index 16ef920076..cd0d59cf24 100644 --- a/specification/_global/get/GetRequest.ts +++ b/specification/_global/get/GetRequest.ts @@ -41,6 +41,13 @@ export interface Request extends RequestBase { index: IndexName } query_parameters: { + /** + * Should this request force synthetic _source? + * Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. + * Fetches with this enabled will be slower the enabling synthetic source natively in the index. + * @availability stack since=8.4.0 visibility=feature_flag feature_flag=es.index_mode_feature_flag_registered + */ + force_synthetic_source?: boolean /** * Specifies the node or shard the operation should be performed on. Random by default. */ diff --git a/specification/_global/mget/MultiGetRequest.ts b/specification/_global/mget/MultiGetRequest.ts index 2a929d7ad5..daaa676f89 100644 --- a/specification/_global/mget/MultiGetRequest.ts +++ b/specification/_global/mget/MultiGetRequest.ts @@ -36,6 +36,13 @@ export interface Request extends RequestBase { index?: IndexName } query_parameters: { + /** + * Should this request force synthetic _source? + * Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. + * Fetches with this enabled will be slower the enabling synthetic source natively in the index. + * @availability stack since=8.4.0 visibility=feature_flag feature_flag=es.index_mode_feature_flag_registered + */ + force_synthetic_source?: boolean /** * Specifies the node or shard the operation should be performed on. Random by default. */ diff --git a/specification/_global/search/SearchRequest.ts b/specification/_global/search/SearchRequest.ts index 2ef86e22a0..9fec1ed183 100644 --- a/specification/_global/search/SearchRequest.ts +++ b/specification/_global/search/SearchRequest.ts @@ -324,6 +324,13 @@ export interface Request extends RequestBase { * @doc_id sort-search-results */ sort?: string | string[] + /** + * Should this request force synthetic _source? + * Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. + * Fetches with this enabled will be slower the enabling synthetic source natively in the index. + * @availability stack since=8.4.0 visibility=feature_flag feature_flag=es.index_mode_feature_flag_registered + */ + force_synthetic_source?: boolean } // We should keep this in sync with the multi search request body. body: {