Class SearchResponseSections

java.lang.Object
org.elasticsearch.action.search.SearchResponseSections
All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment
Direct Known Subclasses:
InternalSearchResponse

public class SearchResponseSections extends Object implements org.elasticsearch.common.xcontent.ToXContentFragment
Base class that holds the various sections which a search response is composed of (hits, aggs, suggestions etc.) and allows to retrieve them. The reason why this class exists is that the high level REST client uses its own classes to parse aggregations into, which are not serializable. This is the common part that can be shared between core and client.
  • Field Details

    • hits

      protected final SearchHits hits
    • aggregations

      protected final Aggregations aggregations
    • suggest

      protected final Suggest suggest
    • profileResults

      protected final SearchProfileShardResults profileResults
    • timedOut

      protected final boolean timedOut
    • terminatedEarly

      protected final Boolean terminatedEarly
    • numReducePhases

      protected final int numReducePhases
  • Constructor Details

  • Method Details

    • timedOut

      public final boolean timedOut()
    • terminatedEarly

      public final Boolean terminatedEarly()
    • hits

      public final SearchHits hits()
    • aggregations

      public final Aggregations aggregations()
    • suggest

      public final Suggest suggest()
    • getNumReducePhases

      public final int getNumReducePhases()
      Returns the number of reduce phases applied to obtain this search response
    • profile

      public final Map<String,​ProfileShardResult> profile()
      Returns the profile results for this search response (including all shards). An empty map is returned if profiling was not enabled
      Returns:
      Profile results
    • toXContent

      public final org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      IOException
    • writeTo

      protected void writeTo(StreamOutput out) throws IOException
      Throws:
      IOException