Class CollapsingTopDocsCollector<T>

  • All Implemented Interfaces:
    Collector, LeafCollector

    public final class CollapsingTopDocsCollector<T>
    extends FirstPassGroupingCollector<T>
    A collector that groups documents based on field values and returns CollapseTopFieldDocs output. The collapsing is done in a single pass by selecting only the top sorted document per collapse key. The value used for the collapse key of each group can be found in CollapseTopFieldDocs.collapseValues. TODO: If the sort is based on score we should propagate the mininum competitive score when orderedGroups is full. This is safe for collapsing since the group sort is the same as the query sort.