Class TopGroupsCollector<T>
- java.lang.Object
-
- org.apache.lucene.search.SimpleCollector
-
- org.apache.lucene.search.grouping.SecondPassGroupingCollector<T>
-
- org.apache.lucene.search.grouping.TopGroupsCollector<T>
-
- Type Parameters:
T- the type of the group value
- All Implemented Interfaces:
Collector,LeafCollector
public class TopGroupsCollector<T> extends SecondPassGroupingCollector<T>
A second-pass collector that collects the TopDocs for each group, and returns them as aTopGroupsobject
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.search.grouping.SecondPassGroupingCollector
groupReducer, groups, groupSelector, totalGroupedHitCount, totalHitCount
-
-
Constructor Summary
Constructors Constructor Description TopGroupsCollector(GroupSelector<T> groupSelector, Collection<SearchGroup<T>> groups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields)Create a new TopGroupsCollector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopGroups<T>getTopGroups(int withinGroupOffset)Get the TopGroups recorded by this collector-
Methods inherited from class org.apache.lucene.search.grouping.SecondPassGroupingCollector
collect, doSetNextReader, getGroupSelector, needsScores, setScorer
-
Methods inherited from class org.apache.lucene.search.SimpleCollector
getLeafCollector
-
-
-
-
Constructor Detail
-
TopGroupsCollector
public TopGroupsCollector(GroupSelector<T> groupSelector, Collection<SearchGroup<T>> groups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields)
Create a new TopGroupsCollector- Parameters:
groupSelector- the group selector used to define groupsgroups- the groups to collect TopDocs forgroupSort- the order in which groups are returnedwithinGroupSort- the order in which documents are sorted in each groupmaxDocsPerGroup- the maximum number of docs to collect for each groupgetScores- if true, record the scores of all docs in each groupgetMaxScores- if true, record the maximum score for each groupfillSortFields- if true, record the sort field values for all docs
-
-