Class TopDocs

    • Field Summary

      Fields 
      Modifier and Type Field Description
      ScoreDoc[] scoreDocs
      The top hits for the query.
      int totalHits
      The total number of hits for the query.
    • Constructor Summary

      Constructors 
      Constructor Description
      TopDocs​(int totalHits, ScoreDoc[] scoreDocs, float maxScore)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getMaxScore()
      Returns the maximum score value encountered.
      static TopDocs merge​(Sort sort, int topN, TopDocs[] shardHits)
      Returns a new TopDocs, containing topN results across the provided TopDocs, sorting by the specified Sort.
      void setMaxScore​(float maxScore)
      Sets the maximum score value encountered.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • totalHits

        public int totalHits
        The total number of hits for the query.
      • scoreDocs

        public ScoreDoc[] scoreDocs
        The top hits for the query.
    • Constructor Detail

      • TopDocs

        public TopDocs​(int totalHits,
                       ScoreDoc[] scoreDocs,
                       float maxScore)
    • Method Detail

      • getMaxScore

        public float getMaxScore()
        Returns the maximum score value encountered. Note that in case scores are not tracked, this returns Float.NaN.
      • setMaxScore

        public void setMaxScore​(float maxScore)
        Sets the maximum score value encountered.