Class ParsedTopHits

java.lang.Object
org.opensearch.search.aggregations.ParsedAggregation
org.opensearch.search.aggregations.metrics.ParsedTopHits
All Implemented Interfaces:
org.opensearch.core.xcontent.ToXContent, org.opensearch.core.xcontent.ToXContentFragment, Aggregation, TopHits

public class ParsedTopHits extends ParsedAggregation implements TopHits
A top_hits agg result parsed between nodes
Opensearch.internal:
  • Constructor Details

    • ParsedTopHits

      public ParsedTopHits()
  • Method Details

    • getType

      public String getType()
      Specified by:
      getType in interface Aggregation
      Returns:
      a string representing the type of the aggregation. This type is added to the aggregation name in the response, so that it can later be used by clients to determine type of the aggregation and parse it into the proper object.
    • getHits

      public SearchHits getHits()
      Specified by:
      getHits in interface TopHits
      Returns:
      The top matching hits for the bucket
    • doXContentBody

      protected org.opensearch.core.xcontent.XContentBuilder doXContentBody(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      doXContentBody in class ParsedAggregation
      Throws:
      IOException
    • fromXContent

      public static ParsedTopHits fromXContent(org.opensearch.core.xcontent.XContentParser parser, String name) throws IOException
      Throws:
      IOException