public abstract class AllGroupHeadsCollector<T> extends SimpleCollector
newCollector(GroupSelector, Sort)
Modifier and Type | Class and Description |
---|---|
static class |
AllGroupHeadsCollector.GroupHead<T>
Represents a group head.
|
Modifier and Type | Field and Description |
---|---|
protected int |
compIDXEnd |
protected LeafReaderContext |
context |
protected Map<T,AllGroupHeadsCollector.GroupHead<T>> |
heads |
protected int[] |
reversed |
protected Scorer |
scorer |
protected Sort |
sort |
Modifier and Type | Method and Description |
---|---|
void |
collect(int doc) |
protected void |
doSetNextReader(LeafReaderContext context) |
protected Collection<? extends AllGroupHeadsCollector.GroupHead<T>> |
getCollectedGroupHeads()
Returns the collected group heads.
|
int |
groupHeadsSize() |
boolean |
needsScores() |
static <T> AllGroupHeadsCollector<T> |
newCollector(GroupSelector<T> selector,
Sort sort)
Create a new AllGroupHeadsCollector based on the type of within-group Sort required
|
protected abstract AllGroupHeadsCollector.GroupHead<T> |
newGroupHead(int doc,
T value,
LeafReaderContext context,
Scorer scorer)
Create a new GroupHead for the given group value, initialized with a doc, context and scorer
|
int[] |
retrieveGroupHeads() |
FixedBitSet |
retrieveGroupHeads(int maxDoc) |
void |
setScorer(Scorer scorer) |
getLeafCollector
protected final Sort sort
protected final int[] reversed
protected final int compIDXEnd
protected Map<T,AllGroupHeadsCollector.GroupHead<T>> heads
protected LeafReaderContext context
protected Scorer scorer
public static <T> AllGroupHeadsCollector<T> newCollector(GroupSelector<T> selector, Sort sort)
T
- the group value typeselector
- a GroupSelector to define the groupssort
- the within-group sort to use to choose the group head documentpublic FixedBitSet retrieveGroupHeads(int maxDoc)
maxDoc
- The maxDoc of the top level IndexReader
.FixedBitSet
containing all group heads.public int[] retrieveGroupHeads()
public int groupHeadsSize()
protected Collection<? extends AllGroupHeadsCollector.GroupHead<T>> getCollectedGroupHeads()
public void collect(int doc) throws IOException
collect
in interface LeafCollector
collect
in class SimpleCollector
IOException
public boolean needsScores()
protected void doSetNextReader(LeafReaderContext context) throws IOException
doSetNextReader
in class SimpleCollector
IOException
public void setScorer(Scorer scorer) throws IOException
setScorer
in interface LeafCollector
setScorer
in class SimpleCollector
IOException
protected abstract AllGroupHeadsCollector.GroupHead<T> newGroupHead(int doc, T value, LeafReaderContext context, Scorer scorer) throws IOException
IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.