org.apache.lucene.search.grouping.dv
Class DVSecondPassGroupingCollector<GROUP_VALUE>

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector<GROUP_VALUE>
          extended by org.apache.lucene.search.grouping.dv.DVSecondPassGroupingCollector<GROUP_VALUE>

public abstract class DVSecondPassGroupingCollector<GROUP_VALUE>
extends AbstractSecondPassGroupingCollector<GROUP_VALUE>

IDV based implementation of AbstractSecondPassGroupingCollector.

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.AbstractSecondPassGroupingCollector
AbstractSecondPassGroupingCollector.SearchGroupDocs<GROUP_VALUE_TYPE>
 
Field Summary
 
Fields inherited from class org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector
groupDocs, groupMap
 
Method Summary
static
<T> DVSecondPassGroupingCollector<T>
create(String groupField, boolean diskResident, DocValues.Type type, Collection<SearchGroup<T>> searchGroups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields)
          Constructs a DVSecondPassGroupingCollector.
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)
           
 
Methods inherited from class org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector
acceptsDocsOutOfOrder, collect, getTopGroups, retrieveGroup, 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> DVSecondPassGroupingCollector<T> create(String groupField,
                                                          boolean diskResident,
                                                          DocValues.Type type,
                                                          Collection<SearchGroup<T>> searchGroups,
                                                          Sort groupSort,
                                                          Sort withinGroupSort,
                                                          int maxDocsPerGroup,
                                                          boolean getScores,
                                                          boolean getMaxScores,
                                                          boolean fillSortFields)
                                               throws IOException
Constructs a DVSecondPassGroupingCollector. Selects and constructs the most optimal second pass collector implementation for grouping by DocValues.

Parameters:
groupField - The field to group by
diskResident - Whether the values to group by should be disk resident
type - The DocValues.Type which is used to select a concrete implementation.
searchGroups - The groups from the first phase search
groupSort - The sort used for the groups
withinGroupSort - The sort used for documents inside a group
maxDocsPerGroup - The maximum number of documents to collect per group
getScores - Whether to include scores for the documents inside a group
getMaxScores - Whether to keep track of the higest score per group
fillSortFields - Whether to include the sort values
Returns:
the most optimal second 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 AbstractSecondPassGroupingCollector<GROUP_VALUE>
Throws:
IOException

setDocValuesSources

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

Parameters:
source - The idv source to be used by concrete implementations
readerContext - The current reader context

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.