public class FunctionAllGroupHeadsCollector extends AbstractAllGroupHeadsCollector<FunctionAllGroupHeadsCollector.GroupHead>
AbstractAllGroupHeadsCollector
for retrieving the most relevant groups when grouping
by ValueSource
.Modifier and Type | Class and Description |
---|---|
class |
FunctionAllGroupHeadsCollector.GroupHead
Holds current head document for a single group.
|
AbstractAllGroupHeadsCollector.TemporalResult
compIDXEnd, reversed, temporalResult
Constructor and Description |
---|
FunctionAllGroupHeadsCollector(ValueSource groupBy,
Map<?,?> vsContext,
Sort sortWithinGroup)
Constructs a
FunctionAllGroupHeadsCollector instance. |
Modifier and Type | Method and Description |
---|---|
protected Collection<FunctionAllGroupHeadsCollector.GroupHead> |
getCollectedGroupHeads()
Returns the collected group heads.
|
protected void |
retrieveGroupHeadAndAddIfNotExist(int doc)
Returns the group head and puts it into
AbstractAllGroupHeadsCollector.temporalResult . |
void |
setNextReader(AtomicReaderContext context)
Called before collecting from each
AtomicReaderContext . |
void |
setScorer(Scorer scorer)
Called before successive calls to
Collector.collect(int) . |
acceptsDocsOutOfOrder, collect, groupHeadsSize, retrieveGroupHeads, retrieveGroupHeads
public FunctionAllGroupHeadsCollector(ValueSource groupBy, Map<?,?> vsContext, Sort sortWithinGroup)
FunctionAllGroupHeadsCollector
instance.groupBy
- The ValueSource
to group byvsContext
- The ValueSource contextsortWithinGroup
- The sort within a groupprotected void retrieveGroupHeadAndAddIfNotExist(int doc) throws IOException
AbstractAllGroupHeadsCollector
AbstractAllGroupHeadsCollector.temporalResult
.
If the group head wasn't encountered before then it will be added to the collected group heads.
The AbstractAllGroupHeadsCollector.TemporalResult.stop
property will be true
if the group head wasn't encountered before
otherwise false
.retrieveGroupHeadAndAddIfNotExist
in class AbstractAllGroupHeadsCollector<FunctionAllGroupHeadsCollector.GroupHead>
doc
- The document to retrieve the group head for.IOException
- If I/O related errors occurprotected Collection<FunctionAllGroupHeadsCollector.GroupHead> getCollectedGroupHeads()
AbstractAllGroupHeadsCollector
getCollectedGroupHeads
in class AbstractAllGroupHeadsCollector<FunctionAllGroupHeadsCollector.GroupHead>
public void setScorer(Scorer scorer) throws IOException
Collector
Collector.collect(int)
. Implementations
that need the score of the current document (passed-in to
Collector.collect(int)
), should save the passed-in Scorer and call
scorer.score() when needed.setScorer
in class Collector
IOException
public void setNextReader(AtomicReaderContext context) throws IOException
Collector
AtomicReaderContext
. 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 Collector
context
- next atomic reader contextIOException
Copyright © 2000-2016 The Apache Software Foundation. All Rights Reserved.