- java.lang.Object
-
- org.apache.lucene.search.HitsThresholdChecker
-
- Direct Known Subclasses:
HitsThresholdChecker.GlobalHitsThresholdChecker
,HitsThresholdChecker.LocalHitsThresholdChecker
abstract class HitsThresholdChecker extends java.lang.Object
Used for defining custom algorithms to allow searches to early terminate
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
HitsThresholdChecker.GlobalHitsThresholdChecker
Implementation of HitsThresholdChecker which allows global hit countingprivate static class
HitsThresholdChecker.LocalHitsThresholdChecker
Default implementation of HitsThresholdChecker to be used for single threaded execution
-
Field Summary
Fields Modifier and Type Field Description private static HitsThresholdChecker
EXACT_HITS_COUNT_THRESHOLD_CHECKER
No-op implementation ofHitsThresholdChecker
that does no counting, as the threshold can never be reached.private int
totalHitsThreshold
-
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 HitsThresholdChecker
create(int totalHitsThreshold)
(package private) static HitsThresholdChecker
createShared(int totalHitsThreshold)
(package private) int
getHitsThreshold()
(package private) abstract void
incrementHitCount()
(package private) abstract boolean
isThresholdReached()
(package private) abstract ScoreMode
scoreMode()
-
-
-
Field Detail
-
EXACT_HITS_COUNT_THRESHOLD_CHECKER
private static final HitsThresholdChecker EXACT_HITS_COUNT_THRESHOLD_CHECKER
No-op implementation ofHitsThresholdChecker
that 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()
-
-