Home » lucene-3.0.1-src » org.apache » lucene » search » [javadoc | source]
org.apache.lucene.search
abstract public class: Scorer [javadoc | source]
java.lang.Object
   org.apache.lucene.search.DocIdSetIterator
      org.apache.lucene.search.Scorer
Expert: Common scoring functionality for different types of queries.

A Scorer iterates over documents matching a query in increasing order of doc Id.

Document scores are computed using a given Similarity implementation.

NOTE: The values Float.Nan, Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY are not valid scores. Certain collectors (eg TopScoreDocCollector ) will not properly collect hits with these scores.
Fields inherited from org.apache.lucene.search.DocIdSetIterator:
NO_MORE_DOCS
Constructor:
 protected Scorer(Similarity similarity) 
    Constructs a Scorer.
    Parameters:
    similarity - The Similarity implementation used by this scorer.
Method from org.apache.lucene.search.Scorer Summary:
getSimilarity,   score,   score,   score
Methods from org.apache.lucene.search.DocIdSetIterator:
advance,   docID,   nextDoc
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.search.Scorer Detail:
 public Similarity getSimilarity() 
    Returns the Similarity implementation used by this scorer.
 abstract public float score() throws IOException
 public  void score(Collector collector) throws IOException 
    Scores and collects all matching documents.
 protected boolean score(Collector collector,
    int max,
    int firstDocID) throws IOException 
    Expert: Collects matching documents in a range. Hook for optimization. Note, firstDocID is added to ensure that #nextDoc() was called before this method.