Class MaxScoreCollector

java.lang.Object
org.apache.lucene.search.SimpleCollector
org.elasticsearch.action.search.MaxScoreCollector
All Implemented Interfaces:
org.apache.lucene.search.Collector, org.apache.lucene.search.LeafCollector

public class MaxScoreCollector extends org.apache.lucene.search.SimpleCollector
A collector that computes the maximum score.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    collect(int doc)
     
    float
    Get the maximum score.
    org.apache.lucene.search.ScoreMode
     
    void
    setScorer(org.apache.lucene.search.Scorable scorer)
     

    Methods inherited from class org.apache.lucene.search.SimpleCollector

    doSetNextReader, getLeafCollector

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.lucene.search.LeafCollector

    competitiveIterator
  • Constructor Details

    • MaxScoreCollector

      public MaxScoreCollector()
  • Method Details

    • setScorer

      public void setScorer(org.apache.lucene.search.Scorable scorer)
      Specified by:
      setScorer in interface org.apache.lucene.search.LeafCollector
      Overrides:
      setScorer in class org.apache.lucene.search.SimpleCollector
    • scoreMode

      public org.apache.lucene.search.ScoreMode scoreMode()
    • collect

      public void collect(int doc) throws IOException
      Specified by:
      collect in interface org.apache.lucene.search.LeafCollector
      Specified by:
      collect in class org.apache.lucene.search.SimpleCollector
      Throws:
      IOException
    • getMaxScore

      public float getMaxScore()
      Get the maximum score. This returns Float.NaN if no hits were collected.