public abstract class DVAllGroupsCollector<GROUP_VALUE_TYPE> extends AbstractAllGroupsCollector<GROUP_VALUE_TYPE>
AbstractAllGroupsCollector
that groups documents based on
DocValues
fields.Modifier and Type | Method and Description |
---|---|
static <T> DVAllGroupsCollector<T> |
create(String groupField,
DocValues.Type type,
boolean diskResident)
Constructs a
DVAllGroupsCollector . |
static <T> DVAllGroupsCollector<T> |
create(String groupField,
DocValues.Type type,
boolean diskResident,
int initialSize)
Expert: Constructs a
DVAllGroupsCollector . |
protected DocValues.Source |
getDefaultSource(AtomicReaderContext readerContext) |
protected abstract void |
setDocValuesSources(DocValues.Source source,
AtomicReaderContext readerContext)
Sets the idv source for concrete implementations to use.
|
void |
setNextReader(AtomicReaderContext readerContext) |
acceptsDocsOutOfOrder, getGroupCount, getGroups, setScorer
public static <T> DVAllGroupsCollector<T> create(String groupField, DocValues.Type type, boolean diskResident, int initialSize)
DVAllGroupsCollector
.
Selects and constructs the most optimal all groups collector implementation for grouping by DocValues
.groupField
- The field to group bytype
- The DocValues.Type
which is used to select a concrete implementation.diskResident
- Whether the values to group by should be disk residentinitialSize
- The initial allocation size of the
internal int set and group list
which should roughly match the total
number of expected unique groups. Be aware that the
heap usage is 4 bytes * initialSize. Not all concrete implementions use this!DocValues
public static <T> DVAllGroupsCollector<T> create(String groupField, DocValues.Type type, boolean diskResident)
DVAllGroupsCollector
.
Selects and constructs the most optimal all groups collector implementation for grouping by DocValues
.
If implementations require an initial allocation size then this will be set to 128.groupField
- The field to group bytype
- The DocValues.Type
which is used to select a concrete implementation.diskResident
- Wether the values to group by should be disk residentDocValues
public void setNextReader(AtomicReaderContext readerContext) throws IOException
setNextReader
in class Collector
IOException
protected abstract void setDocValuesSources(DocValues.Source source, AtomicReaderContext readerContext)
source
- The idv source to be used by concrete implementationsreaderContext
- The current reader contextprotected DocValues.Source getDefaultSource(AtomicReaderContext readerContext)
readerContext
- The current reader contextCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.