Class SearchResponseSections

java.lang.Object
org.elasticsearch.action.search.SearchResponseSections
All Implemented Interfaces:
Closeable, AutoCloseable, Releasable

public class SearchResponseSections extends Object implements Releasable
Holds some sections that a search response is composed of (hits, aggs, suggestions etc.) during some steps of the search response building.
  • Field Details

    • EMPTY_WITH_TOTAL_HITS

      public static final SearchResponseSections EMPTY_WITH_TOTAL_HITS
    • EMPTY_WITHOUT_TOTAL_HITS

      public static final SearchResponseSections EMPTY_WITHOUT_TOTAL_HITS
    • hits

      protected final SearchHits hits
    • aggregations

      protected final InternalAggregations aggregations
    • suggest

      protected final Suggest suggest
    • profileResults

      protected final SearchProfileResults profileResults
    • timedOut

      protected final boolean timedOut
    • terminatedEarly

      protected final Boolean terminatedEarly
    • numReducePhases

      protected final int numReducePhases
    • timeRangeFilterFromMillis

      protected final Long timeRangeFilterFromMillis
  • Constructor Details

  • Method Details

    • transferTopHitsToRelease

      @Nullable public final List<SearchHits> transferTopHitsToRelease()
      Transfers ownership of the top-hits-to-release list to the caller. Call when building a SearchResponse so close() does not release the list. Returns null if the list was already transferred or was never set.
    • hits

      public final SearchHits hits()
    • suggest

      public final Suggest suggest()
    • profile

      public final Map<String,SearchProfileShardResult> 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
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Releasable