diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 803637dfbd..0b2d1174bb 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -26324,7 +26324,14 @@ "description": "Array of wildcard (`*`) patterns.\nThe request returns doc values for field names matching these patterns in the `hits.fields` property of the response.", "type": "array", "items": { - "$ref": "#/components/schemas/_types.query_dsl:FieldAndFormat" + "oneOf": [ + { + "$ref": "#/components/schemas/_types:Field" + }, + { + "$ref": "#/components/schemas/_types.query_dsl:FieldAndFormat" + } + ] } }, "knn": { @@ -26399,7 +26406,14 @@ "description": "Array of wildcard (`*`) patterns.\nThe request returns values for field names matching these patterns in the `hits.fields` property of the response.", "type": "array", "items": { - "$ref": "#/components/schemas/_types.query_dsl:FieldAndFormat" + "oneOf": [ + { + "$ref": "#/components/schemas/_types.query_dsl:FieldAndFormat" + }, + { + "$ref": "#/components/schemas/_types:Field" + } + ] } }, "suggest": { @@ -34085,6 +34099,9 @@ { "type": "boolean" }, + { + "$ref": "#/components/schemas/_types:Fields" + }, { "$ref": "#/components/schemas/_global.search._types:SourceFilter" } @@ -54996,7 +55013,14 @@ "description": "Array of wildcard (*) patterns. The request returns doc values for field\nnames matching these patterns in the hits.fields property of the response.", "type": "array", "items": { - "$ref": "#/components/schemas/_types.query_dsl:FieldAndFormat" + "oneOf": [ + { + "$ref": "#/components/schemas/_types:Field" + }, + { + "$ref": "#/components/schemas/_types.query_dsl:FieldAndFormat" + } + ] } }, "knn": { @@ -55077,7 +55101,14 @@ "description": "Array of wildcard (*) patterns. The request returns values for field names\nmatching these patterns in the hits.fields property of the response.", "type": "array", "items": { - "$ref": "#/components/schemas/_types.query_dsl:FieldAndFormat" + "oneOf": [ + { + "$ref": "#/components/schemas/_types:Field" + }, + { + "$ref": "#/components/schemas/_types.query_dsl:FieldAndFormat" + } + ] } }, "terminate_after": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 0050906d14..ace2786904 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -26369,7 +26369,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L214-L217" + "specLocation": "_global/msearch/types.ts#L215-L218" }, { "generics": [ @@ -26419,7 +26419,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L204-L207" + "specLocation": "_global/msearch/types.ts#L205-L208" }, { "kind": "interface", @@ -26527,11 +26527,23 @@ "type": { "kind": "array_of", "value": { - "kind": "instance_of", - "type": { - "name": "FieldAndFormat", - "namespace": "_types.query_dsl" - } + "items": [ + { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" + } + } + ], + "kind": "union_of" } } }, @@ -26758,11 +26770,23 @@ "type": { "kind": "array_of", "value": { - "kind": "instance_of", - "type": { - "name": "FieldAndFormat", - "namespace": "_types.query_dsl" - } + "items": [ + { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" + } + } + ], + "kind": "union_of" } } }, @@ -26892,7 +26916,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L71-L202" + "specLocation": "_global/msearch/types.ts#L72-L203" }, { "description": "Contains parameters used to limit or change the subsequent search body request.", @@ -27024,7 +27048,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L53-L68" + "specLocation": "_global/msearch/types.ts#L54-L69" }, { "attachedBehaviors": [ @@ -27235,7 +27259,7 @@ "name": "RequestItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L48-L51", + "specLocation": "_global/msearch/types.ts#L49-L52", "type": { "items": [ { @@ -27305,7 +27329,7 @@ "name": "ResponseItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L209-L212", + "specLocation": "_global/msearch/types.ts#L210-L213", "type": { "items": [ { @@ -30832,11 +30856,23 @@ "type": { "kind": "array_of", "value": { - "kind": "instance_of", - "type": { - "name": "FieldAndFormat", - "namespace": "_types.query_dsl" - } + "items": [ + { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" + } + } + ], + "kind": "union_of" } } }, @@ -31062,11 +31098,23 @@ "type": { "kind": "array_of", "value": { - "kind": "instance_of", - "type": { - "name": "FieldAndFormat", - "namespace": "_types.query_dsl" - } + "items": [ + { + "kind": "instance_of", + "type": { + "name": "FieldAndFormat", + "namespace": "_types.query_dsl" + } + }, + { + "kind": "instance_of", + "type": { + "name": "Field", + "namespace": "_types" + } + } + ], + "kind": "union_of" } } }, @@ -35935,6 +35983,7 @@ { "codegenNames": [ "fetch", + "fields", "filter" ], "description": "Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.", @@ -35953,6 +36002,13 @@ "namespace": "_builtins" } }, + { + "kind": "instance_of", + "type": { + "name": "Fields", + "namespace": "_types" + } + }, { "kind": "instance_of", "type": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index d04598ed78..23d018a05b 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -728,7 +728,7 @@ export interface MsearchMultisearchBody { explain?: boolean ext?: Record stored_fields?: Fields - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] + docvalue_fields?: (Field | QueryDslFieldAndFormat | Field)[] knn?: KnnQuery | KnnQuery[] from?: integer highlight?: SearchHighlight @@ -742,7 +742,7 @@ export interface MsearchMultisearchBody { size?: integer sort?: Sort _source?: SearchSourceConfig - fields?: (QueryDslFieldAndFormat | Field)[] + fields?: (Field | QueryDslFieldAndFormat | Field)[] terminate_after?: long stats?: string[] timeout?: string @@ -1194,7 +1194,7 @@ export interface SearchRequest extends RequestBase { highlight?: SearchHighlight track_total_hits?: SearchTrackHits indices_boost?: Record[] - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] + docvalue_fields?: (Field | QueryDslFieldAndFormat | Field)[] knn?: KnnQuery | KnnQuery[] rank?: RankContainer min_score?: double @@ -1208,7 +1208,7 @@ export interface SearchRequest extends RequestBase { slice?: SlicedScroll sort?: Sort _source?: SearchSourceConfig - fields?: (QueryDslFieldAndFormat | Field)[] + fields?: (QueryDslFieldAndFormat | Field | Field)[] suggest?: SearchSuggester terminate_after?: long timeout?: string @@ -1632,7 +1632,7 @@ export interface SearchSmoothingModelContainer { stupid_backoff?: SearchStupidBackoffSmoothingModel } -export type SearchSourceConfig = boolean | SearchSourceFilter | Fields +export type SearchSourceConfig = boolean | Fields | SearchSourceFilter | Fields export type SearchSourceConfigParam = boolean | Fields diff --git a/specification/_global/msearch/types.ts b/specification/_global/msearch/types.ts index 46934beba4..47c382d1b9 100644 --- a/specification/_global/msearch/types.ts +++ b/specification/_global/msearch/types.ts @@ -23,6 +23,7 @@ import { Dictionary } from '@spec_utils/Dictionary' import { AggregationContainer } from '@_types/aggregations/AggregationContainer' import { ExpandWildcards, + Field, Fields, IndexName, Indices, @@ -96,7 +97,7 @@ export class MultisearchBody { * Array of wildcard (*) patterns. The request returns doc values for field * names matching these patterns in the hits.fields property of the response. */ - docvalue_fields?: FieldAndFormat[] + docvalue_fields?: Array /** * Defines the approximate kNN search to run. * @availability stack since=8.4.0 @@ -146,7 +147,7 @@ export class MultisearchBody { * Array of wildcard (*) patterns. The request returns values for field names * matching these patterns in the hits.fields property of the response. */ - fields?: Array + fields?: Array /** * Maximum number of documents to collect for each shard. If a query reaches this * limit, Elasticsearch terminates the query early. Elasticsearch collects documents diff --git a/specification/_global/search/SearchRequest.ts b/specification/_global/search/SearchRequest.ts index 2ef86e22a0..bdbf484422 100644 --- a/specification/_global/search/SearchRequest.ts +++ b/specification/_global/search/SearchRequest.ts @@ -371,7 +371,7 @@ export interface Request extends RequestBase { * Array of wildcard (`*`) patterns. * The request returns doc values for field names matching these patterns in the `hits.fields` property of the response. */ - docvalue_fields?: FieldAndFormat[] + docvalue_fields?: Array /** * Defines the approximate kNN search to run. * @availability stack since=8.4.0 @@ -442,7 +442,7 @@ export interface Request extends RequestBase { * Array of wildcard (`*`) patterns. * The request returns values for field names matching these patterns in the `hits.fields` property of the response. */ - fields?: Array + fields?: Array /** * Defines a suggester that provides similar looking terms based on a provided text. */ diff --git a/specification/_global/search/_types/SourceFilter.ts b/specification/_global/search/_types/SourceFilter.ts index 6b48c59f79..b2b2c05071 100644 --- a/specification/_global/search/_types/SourceFilter.ts +++ b/specification/_global/search/_types/SourceFilter.ts @@ -32,9 +32,9 @@ export class SourceFilter { /** * Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered. - * @codegen_names fetch, filter + * @codegen_names fetch, fields, filter */ -export type SourceConfig = boolean | SourceFilter +export type SourceConfig = boolean | Fields | SourceFilter /** * Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.