Package org.apache.lucene.search
Record Class TotalHits
java.lang.Object
java.lang.Record
org.apache.lucene.search.TotalHits
- Record Components:
value
- The value of the total hit count. Must be interpreted in the context ofrelation
.relation
- Whethervalue
is the exact hit count, in which caserelation
is equal toTotalHits.Relation.EQUAL_TO
, or a lower bound of the total hit count, in which caserelation
is equal toTotalHits.Relation.GREATER_THAN_OR_EQUAL_TO
.
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 Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
How thevalue
should be interpreted. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.relation()
Returns the value of therelation
record component.toString()
Returns a string representation of this record class.long
value()
Returns the value of thevalue
record component.
-
Constructor Details
-
TotalHits
Sole constructor.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
value
public long value()Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
relation
Returns the value of therelation
record component.- Returns:
- the value of the
relation
record component
-