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 java.lang.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.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected Aggregations aggregations  
    protected SearchHits hits  
    protected int numReducePhases  
    protected SearchProfileShardResults profileResults  
    protected Suggest suggest  
    protected java.lang.Boolean terminatedEarly  
    protected boolean timedOut  

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor Description
    SearchResponseSections​(SearchHits hits, Aggregations aggregations, Suggest suggest, boolean timedOut, java.lang.Boolean terminatedEarly, SearchProfileShardResults profileResults, int numReducePhases)  
  • Method Summary

    Modifier and Type Method Description
    Aggregations aggregations()  
    int getNumReducePhases()
    Returns the number of reduce phases applied to obtain this search response
    SearchHits hits()  
    java.util.Map<java.lang.String,​ProfileShardResult> profile()
    Returns the profile results for this search response (including all shards).
    Suggest suggest()  
    java.lang.Boolean terminatedEarly()  
    boolean timedOut()  
    org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)  
    protected void writeTo​(StreamOutput out)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • 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 java.lang.Boolean terminatedEarly
    • numReducePhases

      protected final int numReducePhases
  • Constructor Details

  • Method Details

    • timedOut

      public final boolean timedOut()
    • terminatedEarly

      public final java.lang.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 java.util.Map<java.lang.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 java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException
    • writeTo

      protected void writeTo​(StreamOutput out) throws java.io.IOException
      Throws:
      java.io.IOException