From 6b31d2b02a3167d68681b9b346359b7de34af1d2 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Tue, 23 Apr 2024 11:14:24 -0500 Subject: [PATCH] Add missing fields property on top_hits aggregation (#2522) * Add missing fields property on top_hits aggregation * Use correct fields type * Update type for docvalue_fields too --- specification/_types/aggregations/metric.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/specification/_types/aggregations/metric.ts b/specification/_types/aggregations/metric.ts index b40f7539a1..2b02431fdc 100644 --- a/specification/_types/aggregations/metric.ts +++ b/specification/_types/aggregations/metric.ts @@ -24,7 +24,7 @@ import { Dictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { Field, Fields } from '@_types/common' import { double, integer, long } from '@_types/Numeric' -import { QueryContainer } from '@_types/query_dsl/abstractions' +import { FieldAndFormat, QueryContainer } from '@_types/query_dsl/abstractions' import { Script, ScriptField } from '@_types/Scripting' import { Aggregation } from './Aggregation' import { Missing } from './AggregationContainer' @@ -338,12 +338,17 @@ export class TopHitsAggregation extends MetricAggregationBase { /** * Fields for which to return doc values. */ - docvalue_fields?: Fields + docvalue_fields?: FieldAndFormat[] /** * If `true`, returns detailed information about score computation as part of a hit. * @server_default false */ explain?: boolean + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + */ + fields?: FieldAndFormat[] /** * Starting document offset. * @server_default 0