Class SearchGroup<T>

  • Direct Known Subclasses:
    CollectedSearchGroup

    public class SearchGroup<T>
    extends java.lang.Object
    Represents a group that is found during the first pass search.
    • Field Detail

      • groupValue

        public T groupValue
        The value that defines this group
      • sortValues

        public java.lang.Object[] sortValues
        The sort values used during sorting. These are the groupSort field values of the highest rank document (by the groupSort) within the group. Can be null if fillFields=false had been passed to FirstPassGroupingCollector.getTopGroups(int)
    • Constructor Detail

      • SearchGroup

        public SearchGroup()
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • merge

        public static <T> java.util.Collection<SearchGroup<T>> merge​(java.util.List<java.util.Collection<SearchGroup<T>>> topGroups,
                                                                     int offset,
                                                                     int topN,
                                                                     Sort groupSort)
        Merges multiple collections of top groups, for example obtained from separate index shards. The provided groupSort must match how the groups were sorted, and the provided SearchGroups must have been computed with fillFields=true passed to FirstPassGroupingCollector.getTopGroups(int).

        NOTE: this returns null if the topGroups is empty.