T - the type of the group valuepublic class TopGroupsCollector<T> extends SecondPassGroupingCollector<T>
TopGroups object| Modifier and Type | Class and Description |
|---|---|
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 getScores,
boolean getMaxScores,
boolean fillSortFields)
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, needsScores, setScorergetLeafCollectorprivate 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 getScores, boolean getMaxScores, boolean fillSortFields)
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