public class TermSecondPassGroupingCollector extends AbstractSecondPassGroupingCollector<String>
AbstractSecondPassGroupingCollector
that groups based on
field values and more specifically uses FieldCache.StringIndex
to collect grouped docs.AbstractSecondPassGroupingCollector.SearchGroupDocs<GROUP_VALUE_TYPE>
groupDocs, groupMap
Constructor and Description |
---|
TermSecondPassGroupingCollector(String groupField,
Collection<SearchGroup<String>> groups,
Sort groupSort,
Sort withinGroupSort,
int maxDocsPerGroup,
boolean getScores,
boolean getMaxScores,
boolean fillSortFields) |
Modifier and Type | Method and Description |
---|---|
protected AbstractSecondPassGroupingCollector.SearchGroupDocs<String> |
retrieveGroup(int doc)
Returns the group the specified doc belongs to or
null if no group could be retrieved. |
void |
setNextReader(IndexReader reader,
int docBase)
Called before collecting from each IndexReader.
|
acceptsDocsOutOfOrder, collect, getTopGroups, setScorer
public TermSecondPassGroupingCollector(String groupField, Collection<SearchGroup<String>> groups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields) throws IOException
IOException
public void setNextReader(IndexReader reader, int docBase) throws IOException
Collector
Collector.collect(int)
will correspond to reader.
Add docBase to the current IndexReaders internal document id to re-base ids
in Collector.collect(int)
.setNextReader
in class AbstractSecondPassGroupingCollector<String>
reader
- next IndexReaderIOException
protected AbstractSecondPassGroupingCollector.SearchGroupDocs<String> retrieveGroup(int doc) throws IOException
AbstractSecondPassGroupingCollector
null
if no group could be retrieved.retrieveGroup
in class AbstractSecondPassGroupingCollector<String>
doc
- The specified docnull
if no group could be retrievedIOException
- If an I/O related error occurred