diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 0f2c9fac3d..feeca44565 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -23442,6 +23442,9 @@ { "$ref": "#/components/parameters/msearch#ignore_unavailable" }, + { + "$ref": "#/components/parameters/msearch#include_named_queries_score" + }, { "$ref": "#/components/parameters/msearch#max_concurrent_searches" }, @@ -23499,6 +23502,9 @@ { "$ref": "#/components/parameters/msearch#ignore_unavailable" }, + { + "$ref": "#/components/parameters/msearch#include_named_queries_score" + }, { "$ref": "#/components/parameters/msearch#max_concurrent_searches" }, @@ -23561,6 +23567,9 @@ { "$ref": "#/components/parameters/msearch#ignore_unavailable" }, + { + "$ref": "#/components/parameters/msearch#include_named_queries_score" + }, { "$ref": "#/components/parameters/msearch#max_concurrent_searches" }, @@ -23621,6 +23630,9 @@ { "$ref": "#/components/parameters/msearch#ignore_unavailable" }, + { + "$ref": "#/components/parameters/msearch#include_named_queries_score" + }, { "$ref": "#/components/parameters/msearch#max_concurrent_searches" }, @@ -26417,6 +26429,9 @@ { "$ref": "#/components/parameters/search#ignore_unavailable" }, + { + "$ref": "#/components/parameters/search#include_named_queries_score" + }, { "$ref": "#/components/parameters/search#lenient" }, @@ -26570,6 +26585,9 @@ { "$ref": "#/components/parameters/search#ignore_unavailable" }, + { + "$ref": "#/components/parameters/search#include_named_queries_score" + }, { "$ref": "#/components/parameters/search#lenient" }, @@ -26728,6 +26746,9 @@ { "$ref": "#/components/parameters/search#ignore_unavailable" }, + { + "$ref": "#/components/parameters/search#include_named_queries_score" + }, { "$ref": "#/components/parameters/search#lenient" }, @@ -26884,6 +26905,9 @@ { "$ref": "#/components/parameters/search#ignore_unavailable" }, + { + "$ref": "#/components/parameters/search#include_named_queries_score" + }, { "$ref": "#/components/parameters/search#lenient" }, @@ -47275,6 +47299,16 @@ }, "style": "form" }, + "msearch#include_named_queries_score": { + "in": "query", + "name": "include_named_queries_score", + "description": "Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, "msearch#max_concurrent_searches": { "in": "query", "name": "max_concurrent_searches", @@ -48211,6 +48245,16 @@ }, "style": "form" }, + "search#include_named_queries_score": { + "in": "query", + "name": "include_named_queries_score", + "description": "Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, "search#lenient": { "in": "query", "name": "lenient", @@ -56113,10 +56157,23 @@ } }, "matched_queries": { - "type": "array", - "items": { - "type": "string" - } + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "number" + } + } + } + ] }, "_nested": { "$ref": "#/components/schemas/_global.search._types:NestedIdentity" diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index ab293c8ae6..42329356ad 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -14650,6 +14650,9 @@ { "$ref": "#/components/parameters/msearch#ignore_unavailable" }, + { + "$ref": "#/components/parameters/msearch#include_named_queries_score" + }, { "$ref": "#/components/parameters/msearch#max_concurrent_searches" }, @@ -14707,6 +14710,9 @@ { "$ref": "#/components/parameters/msearch#ignore_unavailable" }, + { + "$ref": "#/components/parameters/msearch#include_named_queries_score" + }, { "$ref": "#/components/parameters/msearch#max_concurrent_searches" }, @@ -14769,6 +14775,9 @@ { "$ref": "#/components/parameters/msearch#ignore_unavailable" }, + { + "$ref": "#/components/parameters/msearch#include_named_queries_score" + }, { "$ref": "#/components/parameters/msearch#max_concurrent_searches" }, @@ -14829,6 +14838,9 @@ { "$ref": "#/components/parameters/msearch#ignore_unavailable" }, + { + "$ref": "#/components/parameters/msearch#include_named_queries_score" + }, { "$ref": "#/components/parameters/msearch#max_concurrent_searches" }, @@ -16333,6 +16345,9 @@ { "$ref": "#/components/parameters/search#ignore_unavailable" }, + { + "$ref": "#/components/parameters/search#include_named_queries_score" + }, { "$ref": "#/components/parameters/search#lenient" }, @@ -16483,6 +16498,9 @@ { "$ref": "#/components/parameters/search#ignore_unavailable" }, + { + "$ref": "#/components/parameters/search#include_named_queries_score" + }, { "$ref": "#/components/parameters/search#lenient" }, @@ -16638,6 +16656,9 @@ { "$ref": "#/components/parameters/search#ignore_unavailable" }, + { + "$ref": "#/components/parameters/search#include_named_queries_score" + }, { "$ref": "#/components/parameters/search#lenient" }, @@ -16791,6 +16812,9 @@ { "$ref": "#/components/parameters/search#ignore_unavailable" }, + { + "$ref": "#/components/parameters/search#include_named_queries_score" + }, { "$ref": "#/components/parameters/search#lenient" }, @@ -26319,6 +26343,16 @@ }, "style": "form" }, + "msearch#include_named_queries_score": { + "in": "query", + "name": "include_named_queries_score", + "description": "Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, "msearch#max_concurrent_searches": { "in": "query", "name": "max_concurrent_searches", @@ -26870,6 +26904,16 @@ }, "style": "form" }, + "search#include_named_queries_score": { + "in": "query", + "name": "include_named_queries_score", + "description": "Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.", + "deprecated": false, + "schema": { + "type": "boolean" + }, + "style": "form" + }, "search#lenient": { "in": "query", "name": "lenient", @@ -32654,10 +32698,23 @@ } }, "matched_queries": { - "type": "array", - "items": { - "type": "string" - } + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "number" + } + } + } + ] }, "_nested": { "$ref": "#/components/schemas/_global.search._types:NestedIdentity" diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 6c44e61b3f..89e463ff47 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -33720,6 +33720,19 @@ } } }, + { + "description": "Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.", + "name": "include_named_queries_score", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "description": "Maximum number of concurrent searches the multi search API can execute.", "name": "max_concurrent_searches", @@ -33807,7 +33820,7 @@ } } ], - "specLocation": "_global/msearch/MultiSearchRequest.ts#L25-L96" + "specLocation": "_global/msearch/MultiSearchRequest.ts#L25-L106" }, { "body": { @@ -36724,6 +36737,19 @@ } } }, + { + "description": "Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.", + "name": "include_named_queries_score", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "description": "If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can only be used when the `q` query string parameter is specified.", "name": "lenient", @@ -37119,7 +37145,7 @@ } } ], - "specLocation": "_global/search/SearchRequest.ts#L54-L520" + "specLocation": "_global/search/SearchRequest.ts#L54-L530" }, { "body": { @@ -69017,14 +69043,40 @@ "name": "matched_queries", "required": false, "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" + "items": [ + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + } } - } + ], + "kind": "union_of" } }, { diff --git a/output/schema/schema.json b/output/schema/schema.json index f0bdb9c932..5731625378 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -27910,6 +27910,19 @@ } } }, + { + "description": "Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.", + "name": "include_named_queries_score", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "description": "Maximum number of concurrent searches the multi search API can execute.", "name": "max_concurrent_searches", @@ -27997,7 +28010,7 @@ } } ], - "specLocation": "_global/msearch/MultiSearchRequest.ts#L25-L96" + "specLocation": "_global/msearch/MultiSearchRequest.ts#L25-L106" }, { "codegenNames": [ @@ -32183,6 +32196,19 @@ } } }, + { + "description": "Indicates whether hit.matched_queries should be rendered as a map that includes\nthe name of the matched query associated with its score (true)\nor as an array containing the name of the matched queries (false)\nThis functionality reruns each named query on every hit in a search response.\nTypically, this adds a small overhead to a request.\nHowever, using computationally expensive named queries on a large number of hits may add significant overhead.", + "name": "include_named_queries_score", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, { "description": "If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.\nThis parameter can only be used when the `q` query string parameter is specified.", "name": "lenient", @@ -32597,7 +32623,7 @@ } } ], - "specLocation": "_global/search/SearchRequest.ts#L54-L520" + "specLocation": "_global/search/SearchRequest.ts#L54-L530" }, { "body": { @@ -35097,14 +35123,40 @@ "name": "matched_queries", "required": false, "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" + "items": [ + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + } } - } + ], + "kind": "union_of" } }, { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index b00f0c1824..d026b122ab 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -962,6 +962,7 @@ "Request: query parameter 'expand_wildcards' does not exist in the json spec", "Request: query parameter 'ignore_throttled' does not exist in the json spec", "Request: query parameter 'ignore_unavailable' does not exist in the json spec", + "Request: query parameter 'include_named_queries_score' does not exist in the json spec", "Request: query parameter 'routing' does not exist in the json spec" ], "response": [] @@ -1023,7 +1024,6 @@ }, "search": { "request": [ - "Request: missing json spec query parameter 'include_named_queries_score'", "interface definition _types:RankContainer - Property rrf is a single-variant and must be required" ], "response": [] diff --git a/output/typescript/types.ts b/output/typescript/types.ts index d788226fcd..7d61dfa3c7 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -781,6 +781,7 @@ export interface MsearchRequest extends RequestBase { expand_wildcards?: ExpandWildcards ignore_throttled?: boolean ignore_unavailable?: boolean + include_named_queries_score?: boolean max_concurrent_searches?: long max_concurrent_shard_requests?: long pre_filter_shard_size?: long @@ -1159,6 +1160,7 @@ export interface SearchRequest extends RequestBase { explain?: boolean ignore_throttled?: boolean ignore_unavailable?: boolean + include_named_queries_score?: boolean lenient?: boolean max_concurrent_shard_requests?: long min_compatible_shard_node?: VersionString @@ -1461,7 +1463,7 @@ export interface SearchHit { fields?: Record highlight?: Record inner_hits?: Record - matched_queries?: string[] + matched_queries?: string[] | Record _nested?: SearchNestedIdentity _ignored?: string[] ignored_field_values?: Record diff --git a/specification/_global/msearch/MultiSearchRequest.ts b/specification/_global/msearch/MultiSearchRequest.ts index 030f95101b..5c5aa55af4 100644 --- a/specification/_global/msearch/MultiSearchRequest.ts +++ b/specification/_global/msearch/MultiSearchRequest.ts @@ -60,6 +60,16 @@ export interface Request extends RequestBase { * @server_default false */ ignore_unavailable?: boolean + /** + * Indicates whether hit.matched_queries should be rendered as a map that includes + * the name of the matched query associated with its score (true) + * or as an array containing the name of the matched queries (false) + * This functionality reruns each named query on every hit in a search response. + * Typically, this adds a small overhead to a request. + * However, using computationally expensive named queries on a large number of hits may add significant overhead. + * @server_default false + */ + include_named_queries_score?: boolean /** * Maximum number of concurrent searches the multi search API can execute. */ diff --git a/specification/_global/search/SearchRequest.ts b/specification/_global/search/SearchRequest.ts index e9dd15f662..b24f5a2a1a 100644 --- a/specification/_global/search/SearchRequest.ts +++ b/specification/_global/search/SearchRequest.ts @@ -141,6 +141,16 @@ export interface Request extends RequestBase { * @server_default false */ ignore_unavailable?: boolean + /** + * Indicates whether hit.matched_queries should be rendered as a map that includes + * the name of the matched query associated with its score (true) + * or as an array containing the name of the matched queries (false) + * This functionality reruns each named query on every hit in a search response. + * Typically, this adds a small overhead to a request. + * However, using computationally expensive named queries on a large number of hits may add significant overhead. + * @server_default false + */ + include_named_queries_score?: boolean /** * If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. * This parameter can only be used when the `q` query string parameter is specified. diff --git a/specification/_global/search/_types/hits.ts b/specification/_global/search/_types/hits.ts index c98adbdd69..fd24c26142 100644 --- a/specification/_global/search/_types/hits.ts +++ b/specification/_global/search/_types/hits.ts @@ -49,7 +49,7 @@ export class Hit { fields?: Dictionary highlight?: Dictionary inner_hits?: Dictionary - matched_queries?: string[] + matched_queries?: string[] | Dictionary _nested?: NestedIdentity _ignored?: string[] ignored_field_values?: Dictionary