Class TopHitsAggregation

java.lang.Object
co.elastic.clients.elasticsearch._types.aggregations.MetricAggregationBase
co.elastic.clients.elasticsearch._types.aggregations.TopHitsAggregation
All Implemented Interfaces:
AggregationVariant, JsonpSerializable

@JsonpDeserializable public class TopHitsAggregation extends MetricAggregationBase implements AggregationVariant
See Also:
  • Field Details

  • Method Details

    • of

    • _aggregationKind

      public Aggregation.Kind _aggregationKind()
      Aggregation variant kind.
      Specified by:
      _aggregationKind in interface AggregationVariant
    • docvalueFields

      public final List<String> docvalueFields()
      Fields for which to return doc values.

      API name: docvalue_fields

    • explain

      @Nullable public final Boolean explain()
      If true, returns detailed information about score computation as part of a hit.

      API name: explain

    • from

      @Nullable public final Integer from()
      Starting document offset.

      API name: from

    • highlight

      @Nullable public final Highlight highlight()
      Specifies the highlighter to use for retrieving highlighted snippets from one or more fields in the search results.

      API name: highlight

    • scriptFields

      public final Map<String,ScriptField> scriptFields()
      Returns the result of one or more script evaluations for each hit.

      API name: script_fields

    • size

      @Nullable public final Integer size()
      The maximum number of top matching hits to return per bucket.

      API name: size

    • sort

      public final List<SortOptions> sort()
      Sort order of the top matching hits. By default, the hits are sorted by the score of the main query.

      API name: sort

    • source

      @Nullable public final SourceConfig source()
      Selects the fields of the source that are returned.

      API name: _source

    • storedFields

      public final List<String> storedFields()
      Returns values for the specified stored fields (fields that use the store mapping option).

      API name: stored_fields

    • trackScores

      @Nullable public final Boolean trackScores()
      If true, calculates and returns document scores, even if the scores are not used for sorting.

      API name: track_scores

    • version

      @Nullable public final Boolean version()
      If true, returns document version as part of a hit.

      API name: version

    • seqNoPrimaryTerm

      @Nullable public final Boolean seqNoPrimaryTerm()
      If true, returns sequence number and primary term of the last modification of each hit.

      API name: seq_no_primary_term

    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Overrides:
      serializeInternal in class MetricAggregationBase
    • setupTopHitsAggregationDeserializer

      protected static void setupTopHitsAggregationDeserializer(ObjectDeserializer<TopHitsAggregation.Builder> op)