Skip to content

Commit 723ddd8

Browse files
authored
[8.11] Allow single fields in fields and _source parameters (#2330)
(cherry picked from commit 9f40be8)
1 parent fac2aa0 commit 723ddd8

File tree

5 files changed

+94
-37
lines changed

5 files changed

+94
-37
lines changed

output/schema/schema.json

Lines changed: 82 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_global/msearch/types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { Dictionary } from '@spec_utils/Dictionary'
2323
import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
2424
import {
2525
ExpandWildcards,
26+
Field,
2627
Fields,
2728
IndexName,
2829
Indices,
@@ -96,7 +97,7 @@ export class MultisearchBody {
9697
* Array of wildcard (*) patterns. The request returns doc values for field
9798
* names matching these patterns in the hits.fields property of the response.
9899
*/
99-
docvalue_fields?: FieldAndFormat[]
100+
docvalue_fields?: Array<Field | FieldAndFormat>
100101
/**
101102
* Defines the approximate kNN search to run.
102103
* @availability stack since=8.4.0
@@ -146,7 +147,7 @@ export class MultisearchBody {
146147
* Array of wildcard (*) patterns. The request returns values for field names
147148
* matching these patterns in the hits.fields property of the response.
148149
*/
149-
fields?: Array<FieldAndFormat>
150+
fields?: Array<Field | FieldAndFormat>
150151
/**
151152
* Maximum number of documents to collect for each shard. If a query reaches this
152153
* limit, Elasticsearch terminates the query early. Elasticsearch collects documents

specification/_global/search/SearchRequest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ export interface Request extends RequestBase {
371371
* Array of wildcard (`*`) patterns.
372372
* The request returns doc values for field names matching these patterns in the `hits.fields` property of the response.
373373
*/
374-
docvalue_fields?: FieldAndFormat[]
374+
docvalue_fields?: Array<Field | FieldAndFormat>
375375
/**
376376
* Defines the approximate kNN search to run.
377377
* @availability stack since=8.4.0
@@ -442,7 +442,7 @@ export interface Request extends RequestBase {
442442
* Array of wildcard (`*`) patterns.
443443
* The request returns values for field names matching these patterns in the `hits.fields` property of the response.
444444
*/
445-
fields?: Array<FieldAndFormat>
445+
fields?: Array<FieldAndFormat | Field>
446446
/**
447447
* Defines a suggester that provides similar looking terms based on a provided text.
448448
*/

specification/_global/search/_types/SourceFilter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export class SourceFilter {
3232

3333
/**
3434
* Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
35-
* @codegen_names fetch, filter
35+
* @codegen_names fetch, fields, filter
3636
*/
37-
export type SourceConfig = boolean | SourceFilter
37+
export type SourceConfig = boolean | Fields | SourceFilter
3838

3939
/**
4040
* Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

0 commit comments

Comments
 (0)