Interface SearchResultTotal
-
- All Known Implementing Classes:
SimpleSearchResultTotal
public interface SearchResultTotal
The total for a search result, pertaining to all matched documents, independently from the offset/limit used when fetching hits.The total includes in particular the total hit count, which may be exact (default) or just a lower bound estimate (when particular search options are used).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
hitCount()
long
hitCountLowerBound()
boolean
isHitCountExact()
boolean
isHitCountLowerBound()
-
-
-
Method Detail
-
isHitCountExact
boolean isHitCountExact()
- 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
boolean isHitCountLowerBound()
- 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
long hitCount()
- 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.
- Throws:
SearchException
- ifisHitCountLowerBound()
-
hitCountLowerBound
long hitCountLowerBound()
- 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.
-
-