org.apache.lucene.search.grouping.function
Class FunctionAllGroupHeadsCollector
java.lang.Object
org.apache.lucene.search.Collector
org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector<FunctionAllGroupHeadsCollector.GroupHead>
org.apache.lucene.search.grouping.function.FunctionAllGroupHeadsCollector
public class FunctionAllGroupHeadsCollector
- extends AbstractAllGroupHeadsCollector<FunctionAllGroupHeadsCollector.GroupHead>
An implementation of AbstractAllGroupHeadsCollector
for retrieving the most relevant groups when grouping
by ValueSource
.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FunctionAllGroupHeadsCollector
public FunctionAllGroupHeadsCollector(ValueSource groupBy,
Map<?,?> vsContext,
Sort sortWithinGroup)
- Constructs a
FunctionAllGroupHeadsCollector
instance.
- Parameters:
groupBy
- The ValueSource
to group byvsContext
- The ValueSource contextsortWithinGroup
- The sort within a group
retrieveGroupHeadAndAddIfNotExist
protected void retrieveGroupHeadAndAddIfNotExist(int doc)
throws IOException
- Description copied from class:
AbstractAllGroupHeadsCollector
- Returns the group head and puts it into
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
.
- Specified by:
retrieveGroupHeadAndAddIfNotExist
in class AbstractAllGroupHeadsCollector<FunctionAllGroupHeadsCollector.GroupHead>
- Parameters:
doc
- The document to retrieve the group head for.
- Throws:
IOException
- If I/O related errors occur
getCollectedGroupHeads
protected Collection<FunctionAllGroupHeadsCollector.GroupHead> getCollectedGroupHeads()
- Description copied from class:
AbstractAllGroupHeadsCollector
- Returns the collected group heads.
Subsequent calls should return the same group heads.
- Specified by:
getCollectedGroupHeads
in class AbstractAllGroupHeadsCollector<FunctionAllGroupHeadsCollector.GroupHead>
- Returns:
- the collected group heads
setScorer
public void setScorer(Scorer scorer)
throws IOException
- Specified by:
setScorer
in class Collector
- Throws:
IOException
setNextReader
public void setNextReader(AtomicReaderContext context)
throws IOException
- Specified by:
setNextReader
in class Collector
- Throws:
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.