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
BaseFieldComparatorimplementation 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
Constructors Constructor Description SimpleFieldComparator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoSetNextReader(LeafReaderContext context)This method is called before collectingcontext.LeafFieldComparatorgetLeafComparator(LeafReaderContext context)Get a per-segmentLeafFieldComparatorto collect the givenLeafReaderContext.voidsetScorer(Scorable scorer)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
-
-
-
-
Method Detail
-
doSetNextReader
protected abstract void doSetNextReader(LeafReaderContext context) throws IOException
This method is called before collectingcontext.- Throws:
IOException
-
getLeafComparator
public final LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException
Description copied from class:FieldComparatorGet a per-segmentLeafFieldComparatorto collect the givenLeafReaderContext. All docIDs supplied to thisLeafFieldComparatorare relative to the current reader (you must add docBase if you need to map it to a top-level docID).- Specified by:
getLeafComparatorin 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
public void setScorer(Scorable scorer) throws IOException
Description copied from interface:LeafFieldComparatorSets the Scorer to use in case a document's score is needed.- Specified by:
setScorerin interfaceLeafFieldComparator- Parameters:
scorer- Scorer instance that you should use to obtain the current hit's score, if necessary.- Throws:
IOException
-
-