Package org.apache.lucene.search
Class SimpleFieldComparator<T>
java.lang.Object
org.apache.lucene.search.FieldComparator<T>
org.apache.lucene.search.SimpleFieldComparator<T>
- All Implemented Interfaces:
LeafFieldComparator
public abstract class SimpleFieldComparator<T>
extends FieldComparator<T>
implements LeafFieldComparator
Base
FieldComparator
implementation that is used for all contexts.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.FieldComparator
FieldComparator.RelevanceComparator, FieldComparator.TermValComparator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
doSetNextReader
(LeafReaderContext context) This method is called before collectingcontext
.final LeafFieldComparator
getLeafComparator
(LeafReaderContext context) Get a per-segmentLeafFieldComparator
to collect the givenLeafReaderContext
.void
Sets the Scorer to use in case a document's score is needed.Methods inherited from class org.apache.lucene.search.FieldComparator
compare, compareValues, disableSkipping, setSingleSort, setTopValue, value
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.LeafFieldComparator
compareBottom, compareTop, competitiveIterator, copy, setBottom, setHitsThresholdReached
-
Constructor Details
-
SimpleFieldComparator
public SimpleFieldComparator()
-
-
Method Details
-
doSetNextReader
This method is called before collectingcontext
.- Throws:
IOException
-
getLeafComparator
Description copied from class:FieldComparator
Get a per-segmentLeafFieldComparator
to collect the givenLeafReaderContext
. All docIDs supplied to thisLeafFieldComparator
are relative to the current reader (you must add docBase if you need to map it to a top-level docID).- Specified by:
getLeafComparator
in classFieldComparator<T>
- Parameters:
context
- current reader context- Returns:
- the comparator to use for this segment
- Throws:
IOException
- if there is a low-level IO error
-
setScorer
Description copied from interface:LeafFieldComparator
Sets the Scorer to use in case a document's score is needed.- Specified by:
setScorer
in interfaceLeafFieldComparator
- Parameters:
scorer
- Scorer instance that you should use to obtain the current hit's score, if necessary.- Throws:
IOException
-