T
- the type of the group valuepublic class TopGroupsCollector<T> extends SecondPassGroupingCollector<T>
TopGroups
objectModifier and Type | Class and Description |
---|---|
private static class |
TopGroupsCollector.MaxScoreCollector |
private static class |
TopGroupsCollector.TopDocsAndMaxScoreCollector |
private static class |
TopGroupsCollector.TopDocsReducer<T> |
Modifier and Type | Field and Description |
---|---|
private Sort |
groupSort |
private int |
maxDocsPerGroup |
private Sort |
withinGroupSort |
groupReducer, groups, groupSelector, totalGroupedHitCount, totalHitCount
Constructor and Description |
---|
TopGroupsCollector(GroupSelector<T> groupSelector,
java.util.Collection<SearchGroup<T>> groups,
Sort groupSort,
Sort withinGroupSort,
int maxDocsPerGroup,
boolean getMaxScores)
Create a new TopGroupsCollector
|
Modifier and Type | Method and Description |
---|---|
TopGroups<T> |
getTopGroups(int withinGroupOffset)
Get the TopGroups recorded by this collector
|
collect, doSetNextReader, getGroupSelector, scoreMode, setScorer
getLeafCollector
private final Sort groupSort
private final Sort withinGroupSort
private final int maxDocsPerGroup
public TopGroupsCollector(GroupSelector<T> groupSelector, java.util.Collection<SearchGroup<T>> groups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getMaxScores)
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 groupgetMaxScores
- if true, record the maximum score for each group