org.apache.lucene.search.grouping.dv
Class DVFirstPassGroupingCollector<GROUP_VALUE_TYPE>

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.apache.lucene.search.grouping.AbstractFirstPassGroupingCollector<GROUP_VALUE_TYPE>
          extended by org.apache.lucene.search.grouping.dv.DVFirstPassGroupingCollector<GROUP_VALUE_TYPE>

public abstract class DVFirstPassGroupingCollector<GROUP_VALUE_TYPE>
extends AbstractFirstPassGroupingCollector<GROUP_VALUE_TYPE>

IDV based Implementations of AbstractFirstPassGroupingCollector.

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

Field Summary
 
Fields inherited from class org.apache.lucene.search.grouping.AbstractFirstPassGroupingCollector
orderedGroups
 
Method Summary
static
<T> DVFirstPassGroupingCollector<T>
create(Sort groupSort, int topNGroups, String groupField, DocValues.Type type, boolean diskResident)
          Constructs a DVFirstPassGroupingCollector.
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.AbstractFirstPassGroupingCollector
acceptsDocsOutOfOrder, collect, copyDocGroupValue, getDocGroupValue, getTopGroups, 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> DVFirstPassGroupingCollector<T> create(Sort groupSort,
                                                         int topNGroups,
                                                         String groupField,
                                                         DocValues.Type type,
                                                         boolean diskResident)
                                              throws IOException
Constructs a DVFirstPassGroupingCollector. Selects and constructs the most optimal first pass collector implementation for grouping by DocValues.

Parameters:
groupField - The field to group by
topNGroups - The maximum top number of groups to return. Typically this equals to offset + rows.
diskResident - Whether the values to group by should be disk resident
type - The DocValues.Type which is used to select a concrete implementation.
groupSort - The sort used for the groups
Returns:
the most optimal first pass collector implementation for grouping by DocValues
Throws:
IOException - If I/O related errors occur

setNextReader

public void setNextReader(AtomicReaderContext readerContext)
                   throws IOException
Overrides:
setNextReader in class AbstractFirstPassGroupingCollector<GROUP_VALUE_TYPE>
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.