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 Scorable |
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() |
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,
Scorable scorer)
Create a new GroupHead for the given group value, initialized with a doc, context and scorer
|
int[] |
retrieveGroupHeads() |
FixedBitSet |
retrieveGroupHeads(int maxDoc) |
ScoreMode |
scoreMode() |
void |
setScorer(Scorable scorer) |
getLeafCollector
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
competitiveIterator
protected final Sort sort
protected final int[] reversed
protected final int compIDXEnd
protected Map<T,AllGroupHeadsCollector.GroupHead<T>> heads
protected LeafReaderContext context
protected Scorable 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 ScoreMode scoreMode()
protected void doSetNextReader(LeafReaderContext context) throws IOException
doSetNextReader
in class SimpleCollector
IOException
public void setScorer(Scorable scorer) throws IOException
setScorer
in interface LeafCollector
setScorer
in class SimpleCollector
IOException
protected abstract AllGroupHeadsCollector.GroupHead<T> newGroupHead(int doc, T value, LeafReaderContext context, Scorable scorer) throws IOException
IOException
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.