org.apache.lucene.search.grouping
Class TermSecondPassGroupingCollector

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector<String>
          extended by org.apache.lucene.search.grouping.TermSecondPassGroupingCollector

public class TermSecondPassGroupingCollector
extends AbstractSecondPassGroupingCollector<String>

Concrete implementation of AbstractSecondPassGroupingCollector that groups based on field values and more specifically uses FieldCache.StringIndex to collect grouped docs.

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
 
Constructor Summary
TermSecondPassGroupingCollector(String groupField, Collection<SearchGroup<String>> groups, org.apache.lucene.search.Sort groupSort, org.apache.lucene.search.Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields)
           
 
Method Summary
protected  AbstractSecondPassGroupingCollector.SearchGroupDocs<String> retrieveGroup(int doc)
          Returns the group the specified doc belongs to or null if no group could be retrieved.
 void setNextReader(org.apache.lucene.index.IndexReader reader, int docBase)
           
 
Methods inherited from class org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector
acceptsDocsOutOfOrder, collect, getTopGroups, setScorer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermSecondPassGroupingCollector

public TermSecondPassGroupingCollector(String groupField,
                                       Collection<SearchGroup<String>> groups,
                                       org.apache.lucene.search.Sort groupSort,
                                       org.apache.lucene.search.Sort withinGroupSort,
                                       int maxDocsPerGroup,
                                       boolean getScores,
                                       boolean getMaxScores,
                                       boolean fillSortFields)
                                throws IOException
Throws:
IOException
Method Detail

setNextReader

public void setNextReader(org.apache.lucene.index.IndexReader reader,
                          int docBase)
                   throws IOException
Overrides:
setNextReader in class AbstractSecondPassGroupingCollector<String>
Throws:
IOException

retrieveGroup

protected AbstractSecondPassGroupingCollector.SearchGroupDocs<String> retrieveGroup(int doc)
                                                                             throws IOException
Description copied from class: AbstractSecondPassGroupingCollector
Returns the group the specified doc belongs to or null if no group could be retrieved.

Specified by:
retrieveGroup in class AbstractSecondPassGroupingCollector<String>
Parameters:
doc - The specified doc
Returns:
the group the specified doc belongs to or null if no group could be retrieved
Throws:
IOException - If an I/O related error occurred


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