org.apache.lucene.search.grouping.dv
Class DVAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCollector.GroupHead<?>>

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector<GH>
          extended by org.apache.lucene.search.grouping.dv.DVAllGroupHeadsCollector<GH>

public abstract class DVAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCollector.GroupHead<?>>
extends AbstractAllGroupHeadsCollector<GH>

A base implementation of AbstractAllGroupHeadsCollector for retrieving the most relevant groups when grouping on a indexed doc values field.

WARNING: This API is experimental and might change in incompatible ways in the next release.

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector
AbstractAllGroupHeadsCollector.TemporalResult
 
Field Summary
 
Fields inherited from class org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector
compIDXEnd, reversed, temporalResult
 
Method Summary
static
<T extends AbstractAllGroupHeadsCollector.GroupHead<?>>
DVAllGroupHeadsCollector<T>
create(String groupField, Sort sortWithinGroup, DocValues.Type type, boolean diskResident)
          Creates an AbstractAllGroupHeadsCollector instance based on the supplied arguments.
protected  DocValues.Source getDefaultSource(AtomicReaderContext readerContext)
           
protected abstract  void setDocValuesSources(DocValues.Source source)
          Sets the idv source for concrete implementations to use.
 void setNextReader(AtomicReaderContext readerContext)
           
 
Methods inherited from class org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector
acceptsDocsOutOfOrder, collect, getCollectedGroupHeads, groupHeadsSize, retrieveGroupHeadAndAddIfNotExist, retrieveGroupHeads, retrieveGroupHeads
 
Methods inherited from class org.apache.lucene.search.Collector
setScorer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static <T extends AbstractAllGroupHeadsCollector.GroupHead<?>> DVAllGroupHeadsCollector<T> create(String groupField,
                                                                                                         Sort sortWithinGroup,
                                                                                                         DocValues.Type type,
                                                                                                         boolean diskResident)
Creates an AbstractAllGroupHeadsCollector instance based on the supplied arguments. This factory method decides with implementation is best suited.

Parameters:
groupField - The field to group by
sortWithinGroup - The sort within each group
type - The DocValues.Type which is used to select a concrete implementation.
diskResident - Whether the values to group by should be disk resident
Returns:
an AbstractAllGroupHeadsCollector instance based on the supplied arguments

setNextReader

public void setNextReader(AtomicReaderContext readerContext)
                   throws IOException
Specified by:
setNextReader in class Collector
Throws:
IOException

setDocValuesSources

protected abstract void setDocValuesSources(DocValues.Source source)
Sets the idv source for concrete implementations to use.

Parameters:
source - The idv source to be used by concrete implementations

getDefaultSource

protected DocValues.Source getDefaultSource(AtomicReaderContext readerContext)
Parameters:
readerContext - The current reader context
Returns:
The default source when no doc values are available.


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.