public class FunctionFirstPassGroupingCollector extends AbstractFirstPassGroupingCollector<MutableValue>
AbstractFirstPassGroupingCollector that groups based on
ValueSource instances.orderedGroups| Constructor and Description |
|---|
FunctionFirstPassGroupingCollector(ValueSource groupByVS,
Map<?,?> vsContext,
Sort groupSort,
int topNGroups)
Creates a first pass collector.
|
| Modifier and Type | Method and Description |
|---|---|
protected MutableValue |
copyDocGroupValue(MutableValue groupValue,
MutableValue reuse)
Returns a copy of the specified group value by creating a new instance and copying the value from the specified
groupValue in the new instance.
|
protected MutableValue |
getDocGroupValue(int doc)
Returns the group value for the specified doc.
|
void |
setNextReader(AtomicReaderContext readerContext)
Called before collecting from each
AtomicReaderContext. |
acceptsDocsOutOfOrder, collect, getTopGroups, setScorerpublic FunctionFirstPassGroupingCollector(ValueSource groupByVS, Map<?,?> vsContext, Sort groupSort, int topNGroups) throws IOException
groupByVS - The ValueSource instance to group byvsContext - The ValueSource contextgroupSort - The Sort used to sort the
groups. The top sorted document within each group
according to groupSort, determines how that group
sorts against other groups. This must be non-null,
ie, if you want to groupSort by relevance use
Sort.RELEVANCE.topNGroups - How many top groups to keep.IOException - When I/O related errors occurprotected MutableValue getDocGroupValue(int doc)
AbstractFirstPassGroupingCollectorgetDocGroupValue in class AbstractFirstPassGroupingCollector<MutableValue>doc - The specified docprotected MutableValue copyDocGroupValue(MutableValue groupValue, MutableValue reuse)
AbstractFirstPassGroupingCollectorcopyDocGroupValue in class AbstractFirstPassGroupingCollector<MutableValue>groupValue - The group value to copyreuse - Optionally a reuse instance to prevent a new instance creationpublic void setNextReader(AtomicReaderContext readerContext) throws IOException
CollectorAtomicReaderContext. All doc ids in
Collector.collect(int) will correspond to IndexReaderContext.reader().
Add AtomicReaderContext.docBase to the current IndexReaderContext.reader()'s
internal document id to re-base ids in Collector.collect(int).setNextReader in class AbstractFirstPassGroupingCollector<MutableValue>readerContext - next atomic reader contextIOExceptionCopyright © 2000-2016 The Apache Software Foundation. All Rights Reserved.