Class QuerySearchResult

    • Constructor Detail

      • QuerySearchResult

        public QuerySearchResult()
      • QuerySearchResult

        public QuerySearchResult​(StreamInput in)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • QuerySearchResult

        public QuerySearchResult​(long id,
                                 SearchShardTarget shardTarget)
    • Method Detail

      • searchTimedOut

        public void searchTimedOut​(boolean searchTimedOut)
      • searchTimedOut

        public boolean searchTimedOut()
      • terminatedEarly

        public void terminatedEarly​(boolean terminatedEarly)
      • terminatedEarly

        public java.lang.Boolean terminatedEarly()
      • topDocs

        public org.apache.lucene.search.TopDocs topDocs()
      • hasConsumedTopDocs

        public boolean hasConsumedTopDocs()
        Returns true iff the top docs have already been consumed.
      • consumeTopDocs

        public org.apache.lucene.search.TopDocs consumeTopDocs()
        Returns and nulls out the top docs for this search results. This allows to free up memory once the top docs are consumed.
        Throws:
        java.lang.IllegalStateException - if the top docs have already been consumed.
      • topDocs

        public void topDocs​(org.apache.lucene.search.TopDocs topDocs,
                            DocValueFormat[] sortValueFormats)
      • hasAggs

        public boolean hasAggs()
        Returns true if this query result has unconsumed aggregations
      • consumeAggs

        public Aggregations consumeAggs()
        Returns and nulls out the aggregation for this search results. This allows to free up memory once the aggregation is consumed.
        Throws:
        java.lang.IllegalStateException - if the aggregations have already been consumed.
      • consumeProfileResult

        public ProfileShardResult consumeProfileResult()
        Returns and nulls out the profiled results for this search, or potentially null if result was empty. This allows to free up memory once the profiled result is consumed.
        Throws:
        java.lang.IllegalStateException - if the profiled result has already been consumed.
      • hasProfileResults

        public boolean hasProfileResults()
      • profileResults

        public void profileResults​(ProfileShardResult shardResults)
        Sets the finalized profiling results for this query
        Parameters:
        shardResults - The finalized profile
      • suggest

        public Suggest suggest()
      • suggest

        public void suggest​(Suggest suggest)
      • from

        public int from()
      • size

        public int size()
        Returns the maximum size of this results top docs.
      • serviceTimeEWMA

        public long serviceTimeEWMA()
      • serviceTimeEWMA

        public QuerySearchResult serviceTimeEWMA​(long serviceTimeEWMA)
      • nodeQueueSize

        public int nodeQueueSize()
      • hasSuggestHits

        public boolean hasSuggestHits()
        Returns true if this result has any suggest score docs
      • hasSearchContext

        public boolean hasSearchContext()
      • readQuerySearchResult

        public static QuerySearchResult readQuerySearchResult​(StreamInput in)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • readFromWithId

        public void readFromWithId​(long id,
                                   StreamInput in)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeToNoId

        public void writeToNoId​(StreamOutput out)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getTotalHits

        public long getTotalHits()
      • getMaxScore

        public float getMaxScore()