T
- the type of the value used for groupingC
- the type of Collector
used to reduce each grouppublic abstract class GroupReducer<T,C extends Collector> extends Object
newCollector()
, and
LeafCollector.collect(int)
is called for each document that is in
a groupSecondPassGroupingCollector
Constructor and Description |
---|
GroupReducer() |
Modifier and Type | Method and Description |
---|---|
void |
collect(T value,
int doc)
Collect a given document into a given group
|
C |
getCollector(T value)
Get the Collector for a given group
|
abstract boolean |
needsScores()
Whether or not this reducer requires collected documents to be scored
|
protected abstract C |
newCollector()
Creates a new Collector for each group
|
void |
setGroups(Collection<SearchGroup<T>> groups)
Define which groups should be reduced.
|
void |
setNextReader(LeafReaderContext ctx)
Called when the parent
SecondPassGroupingCollector moves to a new segment |
void |
setScorer(Scorable scorer)
Set the Scorer on all group collectors
|
public void setGroups(Collection<SearchGroup<T>> groups)
SecondPassGroupingCollector
public abstract boolean needsScores()
protected abstract C newCollector()
public final void collect(T value, int doc) throws IOException
IOException
- on errorpublic final void setScorer(Scorable scorer) throws IOException
IOException
public final void setNextReader(LeafReaderContext ctx) throws IOException
SecondPassGroupingCollector
moves to a new segmentIOException
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.