Skip to content

Commit dc997f0

Browse files
committed
Allow single fields in fields and _source parameters (#2317)
(cherry picked from commit 9f40be8)
1 parent 4a27c63 commit dc997f0

File tree

5 files changed

+99
-38
lines changed

5 files changed

+99
-38
lines changed

output/schema/schema.json

Lines changed: 84 additions & 27 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,
@@ -95,7 +96,7 @@ export class MultisearchBody {
9596
* Array of wildcard (*) patterns. The request returns doc values for field
9697
* names matching these patterns in the hits.fields property of the response.
9798
*/
98-
docvalue_fields?: FieldAndFormat[]
99+
docvalue_fields?: Array<Field | FieldAndFormat>
99100
/**
100101
* Starting document offset. By default, you cannot page through more than 10,000
101102
* hits using the from and size parameters. To page through more hits, use the
@@ -139,7 +140,7 @@ export class MultisearchBody {
139140
* Array of wildcard (*) patterns. The request returns values for field names
140141
* matching these patterns in the hits.fields property of the response.
141142
*/
142-
fields?: Array<FieldAndFormat>
143+
fields?: Array<Field | FieldAndFormat>
143144
/**
144145
* Maximum number of documents to collect for each shard. If a query reaches this
145146
* limit, Elasticsearch terminates the query early. Elasticsearch collects documents

specification/_global/search/SearchRequest.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export interface Request extends RequestBase {
146146
* Array of wildcard (*) patterns. The request returns doc values for field
147147
* names matching these patterns in the hits.fields property of the response.
148148
*/
149-
docvalue_fields?: FieldAndFormat[]
149+
docvalue_fields?: Array<Field | FieldAndFormat>
150150
/**
151151
* Minimum _score for matching documents. Documents with a lower _score are
152152
* not included in the search results.
@@ -183,7 +183,10 @@ export interface Request extends RequestBase {
183183
* Array of wildcard (*) patterns. The request returns values for field names
184184
* matching these patterns in the hits.fields property of the response.
185185
*/
186-
fields?: Array<FieldAndFormat>
186+
fields?: Array<FieldAndFormat | Field>
187+
/**
188+
* Defines a suggester that provides similar looking terms based on a provided text.
189+
*/
187190
suggest?: Suggester
188191
/**
189192
* Maximum number of documents to collect for each shard. If a query reaches this

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)