Package org.apache.lucene.search
Class TotalHits
- java.lang.Object
- 
- org.apache.lucene.search.TotalHits
 
- 
 public final class TotalHits extends Object Description of the total number of hits of a query. The total hit count can't generally be computed accurately without visiting all matches, which is costly for queries that match lots of documents. Given that it is often enough to have a lower bounds of the number of hits, such as "there are more than 1000 hits", Lucene has options to stop counting as soon as a threshold has been reached in order to improve query times.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classTotalHits.RelationHow thevalueshould be interpreted.
 - 
Field SummaryFields Modifier and Type Field Description TotalHits.RelationrelationWhethervalueis the exact hit count, in which caserelationis equal toTotalHits.Relation.EQUAL_TO, or a lower bound of the total hit count, in which caserelationis equal toTotalHits.Relation.GREATER_THAN_OR_EQUAL_TO.longvalueThe value of the total hit count.
 - 
Constructor SummaryConstructors Constructor Description TotalHits(long value, TotalHits.Relation relation)Sole constructor.
 
- 
- 
- 
Field Detail- 
valuepublic final long value The value of the total hit count. Must be interpreted in the context ofrelation.
 - 
relationpublic final TotalHits.Relation relation Whethervalueis the exact hit count, in which caserelationis equal toTotalHits.Relation.EQUAL_TO, or a lower bound of the total hit count, in which caserelationis equal toTotalHits.Relation.GREATER_THAN_OR_EQUAL_TO.
 
- 
 - 
Constructor Detail- 
TotalHitspublic TotalHits(long value, TotalHits.Relation relation)Sole constructor.
 
- 
 
-