Skip to content

Commit 53f0ee8

Browse files
[Backport 8.14] Add missing fields property on top_hits aggregation (#2530)
* Add missing fields property on top_hits aggregation * Use correct fields type * Update type for docvalue_fields too (cherry picked from commit 6b31d2b) Co-authored-by: Josh Mock <joshua.mock@elastic.co>
1 parent 398739c commit 53f0ee8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

specification/_types/aggregations/metric.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { Dictionary } from '@spec_utils/Dictionary'
2424
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2525
import { Field, Fields } from '@_types/common'
2626
import { double, integer, long } from '@_types/Numeric'
27-
import { QueryContainer } from '@_types/query_dsl/abstractions'
27+
import { FieldAndFormat, QueryContainer } from '@_types/query_dsl/abstractions'
2828
import { Script, ScriptField } from '@_types/Scripting'
2929
import { Aggregation } from './Aggregation'
3030
import { Missing } from './AggregationContainer'
@@ -338,12 +338,17 @@ export class TopHitsAggregation extends MetricAggregationBase {
338338
/**
339339
* Fields for which to return doc values.
340340
*/
341-
docvalue_fields?: Fields
341+
docvalue_fields?: FieldAndFormat[]
342342
/**
343343
* If `true`, returns detailed information about score computation as part of a hit.
344344
* @server_default false
345345
*/
346346
explain?: boolean
347+
/**
348+
* Array of wildcard (*) patterns. The request returns values for field names
349+
* matching these patterns in the hits.fields property of the response.
350+
*/
351+
fields?: FieldAndFormat[]
347352
/**
348353
* Starting document offset.
349354
* @server_default 0

0 commit comments

Comments
 (0)