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 group
totalHits - Total hits within this group
scoreDocs - Hits; this may be FieldDoc 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 to FirstPassGroupingCollector.

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 Details

    • score

      private final float score
      The field for the score record component.
    • maxScore

      private final float maxScore
      The field for the maxScore record component.
    • totalHits

      private final TotalHits totalHits
      The field for the totalHits record component.
    • scoreDocs

      private final ScoreDoc[] scoreDocs
      The field for the scoreDocs record component.
    • groupValue

      private final T groupValue
      The field for the groupValue record component.
    • groupSortValues

      private final Object[] groupSortValues
      The field for the groupSortValues record component.
  • Constructor Details

    • GroupDocs

      public GroupDocs(float score, float maxScore, TotalHits totalHits, ScoreDoc[] scoreDocs, T groupValue, Object[] groupSortValues)
      Creates an instance of a GroupDocs record class.
      Parameters:
      score - the value for the score record component
      maxScore - the value for the maxScore record component
      totalHits - the value for the totalHits record component
      scoreDocs - the value for the scoreDocs record component
      groupValue - the value for the groupValue record component
      groupSortValues - the value for the groupSortValues record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • score

      public float score()
      Returns the value of the score record component.
      Returns:
      the value of the score record component
    • maxScore

      public float maxScore()
      Returns the value of the maxScore record component.
      Returns:
      the value of the maxScore record component
    • totalHits

      public TotalHits totalHits()
      Returns the value of the totalHits record component.
      Returns:
      the value of the totalHits record component
    • scoreDocs

      public ScoreDoc[] scoreDocs()
      Returns the value of the scoreDocs record component.
      Returns:
      the value of the scoreDocs record component
    • groupValue

      public T groupValue()
      Returns the value of the groupValue record component.
      Returns:
      the value of the groupValue record component
    • groupSortValues

      public Object[] groupSortValues()
      Returns the value of the groupSortValues record component.
      Returns:
      the value of the groupSortValues record component