Module org.apache.lucene.grouping
Record Class GroupDocs<T>
java.lang.Object
java.lang.Record
org.apache.lucene.search.grouping.GroupDocs<T>
- Record Components:
score
- Overall aggregated score of this group (currently only set by join queries).maxScore
- Max score in this grouptotalHits
- Total hits within this groupscoreDocs
- Hits; this may beFieldDoc
instances if the withinGroupSort sorted by fields.groupValue
- The groupField value for all docs in this group; this may be null if hits did not have the groupField.groupSortValues
- Matches the groupSort passed toFirstPassGroupingCollector
.
public record GroupDocs<T>(float score, float maxScore, TotalHits totalHits, ScoreDoc[] scoreDocs, T groupValue, Object[] groupSortValues)
extends Record
Represents one group in the results.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Object[]
The field for thegroupSortValues
record component.private final T
The field for thegroupValue
record component.private final float
The field for themaxScore
record component.private final float
The field for thescore
record component.private final ScoreDoc[]
The field for thescoreDocs
record component.private final TotalHits
The field for thetotalHits
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Object[]
Returns the value of thegroupSortValues
record component.Returns the value of thegroupValue
record component.final int
hashCode()
Returns a hash code value for this object.float
maxScore()
Returns the value of themaxScore
record component.float
score()
Returns the value of thescore
record component.ScoreDoc[]
Returns the value of thescoreDocs
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetotalHits
record component.
-
Field Details
-
score
private final float scoreThe field for thescore
record component. -
maxScore
private final float maxScoreThe field for themaxScore
record component. -
totalHits
The field for thetotalHits
record component. -
scoreDocs
The field for thescoreDocs
record component. -
groupValue
The field for thegroupValue
record component. -
groupSortValues
The field for thegroupSortValues
record component.
-
-
Constructor Details
-
GroupDocs
public GroupDocs(float score, float maxScore, TotalHits totalHits, ScoreDoc[] scoreDocs, T groupValue, Object[] groupSortValues) Creates an instance of aGroupDocs
record class.- Parameters:
score
- the value for thescore
record componentmaxScore
- the value for themaxScore
record componenttotalHits
- the value for thetotalHits
record componentscoreDocs
- the value for thescoreDocs
record componentgroupValue
- the value for thegroupValue
record componentgroupSortValues
- the value for thegroupSortValues
record component
-
-
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 '=='. -
score
public float score()Returns the value of thescore
record component.- Returns:
- the value of the
score
record component
-
maxScore
public float maxScore()Returns the value of themaxScore
record component.- Returns:
- the value of the
maxScore
record component
-
totalHits
Returns the value of thetotalHits
record component.- Returns:
- the value of the
totalHits
record component
-
scoreDocs
Returns the value of thescoreDocs
record component.- Returns:
- the value of the
scoreDocs
record component
-
groupValue
Returns the value of thegroupValue
record component.- Returns:
- the value of the
groupValue
record component
-
groupSortValues
Returns the value of thegroupSortValues
record component.- Returns:
- the value of the
groupSortValues
record component
-