Package org.apache.lucene.search
Class HitsThresholdChecker
- java.lang.Object
-
- org.apache.lucene.search.HitsThresholdChecker
-
- Direct Known Subclasses:
HitsThresholdChecker.GlobalHitsThresholdChecker,HitsThresholdChecker.LocalHitsThresholdChecker
abstract class HitsThresholdChecker extends java.lang.ObjectUsed for defining custom algorithms to allow searches to early terminate
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classHitsThresholdChecker.GlobalHitsThresholdCheckerImplementation of HitsThresholdChecker which allows global hit countingprivate static classHitsThresholdChecker.LocalHitsThresholdCheckerDefault implementation of HitsThresholdChecker to be used for single threaded execution
-
Field Summary
Fields Modifier and Type Field Description private static HitsThresholdCheckerEXACT_HITS_COUNT_THRESHOLD_CHECKERNo-op implementation ofHitsThresholdCheckerthat does no counting, as the threshold can never be reached.private inttotalHitsThreshold
-
Constructor Summary
Constructors Constructor Description HitsThresholdChecker(int totalHitsThreshold)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static HitsThresholdCheckercreate(int totalHitsThreshold)(package private) static HitsThresholdCheckercreateShared(int totalHitsThreshold)(package private) intgetHitsThreshold()(package private) abstract voidincrementHitCount()(package private) abstract booleanisThresholdReached()(package private) abstract ScoreModescoreMode()
-
-
-
Field Detail
-
EXACT_HITS_COUNT_THRESHOLD_CHECKER
private static final HitsThresholdChecker EXACT_HITS_COUNT_THRESHOLD_CHECKER
No-op implementation ofHitsThresholdCheckerthat does no counting, as the threshold can never be reached. This is useful for cases where early termination is never desired, so that the overhead of counting hits can be avoided.
-
totalHitsThreshold
private final int totalHitsThreshold
-
-
Method Detail
-
create
static HitsThresholdChecker create(int totalHitsThreshold)
-
createShared
static HitsThresholdChecker createShared(int totalHitsThreshold)
-
getHitsThreshold
final int getHitsThreshold()
-
isThresholdReached
abstract boolean isThresholdReached()
-
scoreMode
abstract ScoreMode scoreMode()
-
incrementHitCount
abstract void incrementHitCount()
-
-