diff --git a/output/schema/schema.json b/output/schema/schema.json index 59bb69f964..f490ef18fc 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -18709,7 +18709,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L207-L210" + "specLocation": "_global/msearch/types.ts#L208-L211" }, { "generics": [ @@ -18759,7 +18759,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L197-L200" + "specLocation": "_global/msearch/types.ts#L198-L201" }, { "kind": "interface", @@ -18867,11 +18867,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" } } }, @@ -19063,11 +19075,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" } } }, @@ -19197,7 +19221,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L70-L195" + "specLocation": "_global/msearch/types.ts#L71-L196" }, { "description": "Contains parameters used to limit or change the subsequent search body request.", @@ -19329,7 +19353,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L52-L67" + "specLocation": "_global/msearch/types.ts#L53-L68" }, { "attachedBehaviors": [ @@ -19551,7 +19575,7 @@ "name": "RequestItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L47-L50", + "specLocation": "_global/msearch/types.ts#L48-L51", "type": { "items": [ { @@ -19621,7 +19645,7 @@ "name": "ResponseItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L202-L205", + "specLocation": "_global/msearch/types.ts#L203-L206", "type": { "items": [ { @@ -22950,11 +22974,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" } } }, @@ -23119,15 +23155,28 @@ "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" } } }, { + "description": "Defines a suggester that provides similar looking terms based on a provided text.", "name": "suggest", "required": false, "type": { @@ -23828,7 +23877,7 @@ } } ], - "specLocation": "_global/search/SearchRequest.ts#L51-L240" + "specLocation": "_global/search/SearchRequest.ts#L51-L243" }, { "body": { @@ -27784,6 +27833,7 @@ { "codegenNames": [ "fetch", + "fields", "filter" ], "description": "Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.", @@ -27802,6 +27852,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 c352776067..d8773b239d 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -553,7 +553,7 @@ export interface MsearchMultisearchBody { explain?: boolean ext?: Record stored_fields?: Fields - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] + docvalue_fields?: (Field | QueryDslFieldAndFormat | Field)[] from?: integer highlight?: SearchHighlight indices_boost?: Record[] @@ -566,7 +566,7 @@ export interface MsearchMultisearchBody { size?: integer sort?: Sort _source?: SearchSourceConfig - fields?: (QueryDslFieldAndFormat | Field)[] + fields?: (Field | QueryDslFieldAndFormat | Field)[] terminate_after?: long stats?: string[] timeout?: string @@ -1018,7 +1018,7 @@ export interface SearchRequest extends RequestBase { highlight?: SearchHighlight track_total_hits?: SearchTrackHits indices_boost?: Record[] - docvalue_fields?: (QueryDslFieldAndFormat | Field)[] + docvalue_fields?: (Field | QueryDslFieldAndFormat | Field)[] min_score?: double post_filter?: QueryDslQueryContainer profile?: boolean @@ -1030,7 +1030,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 @@ -1455,7 +1455,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 fe3bce08cf..41f2c4f556 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, @@ -95,7 +96,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 /** * Starting document offset. By default, you cannot page through more than 10,000 * hits using the from and size parameters. To page through more hits, use the @@ -139,7 +140,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 428d92bdba..bcabb28327 100644 --- a/specification/_global/search/SearchRequest.ts +++ b/specification/_global/search/SearchRequest.ts @@ -146,7 +146,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 /** * Minimum _score for matching documents. Documents with a lower _score are * not included in the search results. @@ -183,7 +183,10 @@ 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. + */ suggest?: Suggester /** * Maximum number of documents to collect for each shard. If a query reaches this 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.