public class FunctionDistinctValuesCollector extends AbstractDistinctValuesCollector<FunctionDistinctValuesCollector.GroupCount>
AbstractDistinctValuesCollector.| Modifier and Type | Class and Description |
|---|---|
static class |
FunctionDistinctValuesCollector.GroupCount
Holds distinct values for a single group.
|
| Modifier and Type | Field and Description |
|---|---|
private FunctionValues.ValueFiller |
countFiller |
private MutableValue |
countMval |
private ValueSource |
countSource |
private FunctionValues.ValueFiller |
groupFiller |
private java.util.Map<MutableValue,FunctionDistinctValuesCollector.GroupCount> |
groupMap |
private MutableValue |
groupMval |
private ValueSource |
groupSource |
private java.util.Map<?,?> |
vsContext |
| Constructor and Description |
|---|
FunctionDistinctValuesCollector(java.util.Map<?,?> vsContext,
ValueSource groupSource,
ValueSource countSource,
java.util.Collection<SearchGroup<MutableValue>> groups) |
| Modifier and Type | Method and Description |
|---|---|
void |
collect(int doc)
Called once for every document matching a query, with the unbased document
number.
|
protected void |
doSetNextReader(LeafReaderContext context)
This method is called before collecting
context. |
java.util.List<FunctionDistinctValuesCollector.GroupCount> |
getGroups()
Returns all unique values for each top N group.
|
needsScoresgetLeafCollector, setScorerprivate final java.util.Map<?,?> vsContext
private final ValueSource groupSource
private final ValueSource countSource
private final java.util.Map<MutableValue,FunctionDistinctValuesCollector.GroupCount> groupMap
private FunctionValues.ValueFiller groupFiller
private FunctionValues.ValueFiller countFiller
private MutableValue groupMval
private MutableValue countMval
public FunctionDistinctValuesCollector(java.util.Map<?,?> vsContext,
ValueSource groupSource,
ValueSource countSource,
java.util.Collection<SearchGroup<MutableValue>> groups)
public java.util.List<FunctionDistinctValuesCollector.GroupCount> getGroups()
AbstractDistinctValuesCollectorgetGroups in class AbstractDistinctValuesCollector<FunctionDistinctValuesCollector.GroupCount>public void collect(int doc)
throws java.io.IOException
LeafCollectorNote: The collection of the current segment can be terminated by throwing
a CollectionTerminatedException. In this case, the last docs of the
current LeafReaderContext will be skipped and IndexSearcher
will swallow the exception and continue collection with the next leaf.
Note: This is called in an inner search loop. For good search performance,
implementations of this method should not call IndexSearcher.doc(int) or
IndexReader.document(int) on every hit.
Doing so can slow searches by an order of magnitude or more.
collect in interface LeafCollectorcollect in class SimpleCollectorjava.io.IOExceptionprotected void doSetNextReader(LeafReaderContext context) throws java.io.IOException
SimpleCollectorcontext.doSetNextReader in class SimpleCollectorjava.io.IOException