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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoSetNextReader(LeafReaderContext context) This method is called before collectingcontext.final LeafFieldComparatorgetLeafComparator(LeafReaderContext context) Get a per-segmentLeafFieldComparatorto collect the givenLeafReaderContext.voidSets 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, valueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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: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
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
-