Class SimpleSearchResultTotal
- java.lang.Object
-
- org.hibernate.search.engine.search.query.spi.SimpleSearchResultTotal
-
- All Implemented Interfaces:
SearchResultTotal
public class SimpleSearchResultTotal extends Object implements SearchResultTotal
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SimpleSearchResultTotal
exact(long totalHitCount)
long
hitCount()
long
hitCountLowerBound()
boolean
isHitCountExact()
boolean
isHitCountLowerBound()
static SimpleSearchResultTotal
lowerBound(long totalHitCount)
static SimpleSearchResultTotal
of(long totalHitCount, boolean isExact)
String
toString()
-
-
-
Method Detail
-
of
public static SimpleSearchResultTotal of(long totalHitCount, boolean isExact)
-
exact
public static SimpleSearchResultTotal exact(long totalHitCount)
-
lowerBound
public static SimpleSearchResultTotal lowerBound(long totalHitCount)
-
isHitCountExact
public boolean isHitCountExact()
- Specified by:
isHitCountExact
in interfaceSearchResultTotal
- Returns:
- Whether the total hit count is exact.
The total hit count is exact by default, but that can change when a
SearchQueryOptionsStep.totalHitCountThreshold(long)
or aSearchQueryOptionsStep.truncateAfter(long, TimeUnit)
has been defined for the current query.
-
isHitCountLowerBound
public boolean isHitCountLowerBound()
- Specified by:
isHitCountLowerBound
in interfaceSearchResultTotal
- Returns:
- Whether the total hit count is a lower-bound estimate.
The total hit count can be a lower bound only when a
SearchQueryOptionsStep.totalHitCountThreshold(long)
or aSearchQueryOptionsStep.truncateAfter(long, TimeUnit)
has been defined for the current query.
-
hitCount
public long hitCount()
- Specified by:
hitCount
in interfaceSearchResultTotal
- Returns:
- The exact value of the total hit count, if available. Unless you used particular search options, you can safely assume the exact value of the total hit count is available.
-
hitCountLowerBound
public long hitCountLowerBound()
- Specified by:
hitCountLowerBound
in interfaceSearchResultTotal
- Returns:
- A lower-bound estimate of the total hit count. If the total hit count is known exactly, the exact total hit count is returned.
-
-