public abstract class AllGroupsCollector<T> extends SimpleCollector
This is an abstract version. Concrete implementations define what a group actually is and how it is internally collected.
Constructor and Description |
---|
AllGroupsCollector() |
Modifier and Type | Method and Description |
---|---|
int |
getGroupCount()
Returns the total number of groups for the executed search.
|
abstract Collection<T> |
getGroups()
Returns the group values
|
boolean |
needsScores()
Indicates if document scores are needed by this collector.
|
void |
setScorer(Scorer scorer)
Called before successive calls to
LeafCollector.collect(int) . |
collect, doSetNextReader, getLeafCollector
public AllGroupsCollector()
public int getGroupCount()
getGroups().size()
public abstract Collection<T> getGroups()
This is an unordered collections of group values. For each group that matched the query there is a BytesRef
representing a group value.
public void setScorer(Scorer scorer) throws IOException
LeafCollector
LeafCollector.collect(int)
. Implementations
that need the score of the current document (passed-in to
LeafCollector.collect(int)
), should save the passed-in Scorer and call
scorer.score() when needed.setScorer
in interface LeafCollector
setScorer
in class SimpleCollector
IOException
public boolean needsScores()
Collector
true
if scores are needed.