The Scorer type exposes the following members.

Constructors

  NameDescription
Protected methodScorer
Constructs a Scorer.

Methods

  NameDescription
Public methodAdvance
Advances to the first beyond the current whose document number is greater than or equal to target. Returns the current document number or {@link #NO_MORE_DOCS} if there are no more docs in the set.

Behaves as if written:

            int advance(int target) {
            int doc;
            while ((doc = nextDoc()) < target) {
            }
            return doc;
            }
            
Some implementations are considerably more efficient than that.

NOTE: certain implemenations may return a different value (each time) if called several times in a row with the same target.

NOTE: this method may be called with {@value #NO_MORE_DOCS} for efficiency by some Scorers. If your implementation cannot efficiently determine that it should exhaust, it is recommended that you check for that value in each call to this method.

NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behavior.

NOTE: in 3.0 this method will become abstract, following the removal of {@link #SkipTo(int)}.

(Inherited from DocIdSetIterator.)
Public methodDoc Obsolete.
Unsupported anymore. Call {@link #DocID()} instead. This method throws {@link UnsupportedOperationException} if called.
(Inherited from DocIdSetIterator.)
Public methodDocID
Returns the following:
  • -1 or {@link #NO_MORE_DOCS} if {@link #NextDoc()} or {@link #Advance(int)} were not called yet.
  • {@link #NO_MORE_DOCS} if the iterator has exhausted.
  • Otherwise it should return the doc ID it is currently on.

NOTE: in 3.0, this method will become abstract.

(Inherited from DocIdSetIterator.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodExplain
Returns an explanation of the score for a document.
When this method is used, the {@link #Next()}, {@link #SkipTo(int)} and {@link #Score(HitCollector)} methods should not be used.
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetSimilarity
Returns the Similarity implementation used by this scorer.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNext Obsolete.
Unsupported anymore. Call {@link #NextDoc()} instead. This method throws {@link UnsupportedOperationException} if called.
(Inherited from DocIdSetIterator.)
Public methodNextDoc
Advances to the next document in the set and returns the doc it is currently on, or {@link #NO_MORE_DOCS} if there are no more docs in the set.
NOTE: in 3.0 this method will become abstract, following the removal of {@link #Next()}. For backward compatibility it is implemented as:
            public int nextDoc() throws IOException {
            return next() ? doc() : NO_MORE_DOCS;
            }
            
NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behavior.
(Inherited from DocIdSetIterator.)
Public methodScore()()()()
Returns the score of the current document matching the query. Initially invalid, until {@link #Next()} or {@link #SkipTo(int)} is called the first time, or when called from within {@link Collector#collect}.
Public methodScore(Collector)
Scores and collects all matching documents.
Public methodScore(HitCollector) Obsolete.
Scores and collects all matching documents.
Protected methodScore(HitCollector, Int32) Obsolete.
Expert: Collects matching documents in a range. Hook for optimization. Note that {@link #Next()} must be called once before this method is called for the first time.
Public methodScore(Collector, Int32, Int32)
Expert: Collects matching documents in a range. Hook for optimization. Note,
CopyC#
firstDocID
is added to ensure that {@link #NextDoc()} was called before this method.
Public methodSkipTo Obsolete.
Unsupported anymore. Call {@link #Advance(int)} instead. This method throws {@link UnsupportedOperationException} if called.
(Inherited from DocIdSetIterator.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)

See Also