org.apache.lucene.search.grouping
Class SecondPassGroupingCollector

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.apache.lucene.search.grouping.SecondPassGroupingCollector

public class SecondPassGroupingCollector
extends org.apache.lucene.search.Collector

SecondPassGroupingCollector is the second of two passes necessary to collect grouped docs. This pass gathers the top N documents per top group computed from the first pass.

See org.apache.lucene.search.grouping for more details including a full code example.

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

Constructor Summary
SecondPassGroupingCollector(String groupField, Collection<SearchGroup> groups, org.apache.lucene.search.Sort groupSort, org.apache.lucene.search.Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields)
           
 
Method Summary
 boolean acceptsDocsOutOfOrder()
           
 void collect(int doc)
           
 TopGroups getTopGroups(int withinGroupOffset)
           
 void setNextReader(org.apache.lucene.index.IndexReader reader, int docBase)
           
 void setScorer(org.apache.lucene.search.Scorer scorer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecondPassGroupingCollector

public SecondPassGroupingCollector(String groupField,
                                   Collection<SearchGroup> 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

setScorer

public void setScorer(org.apache.lucene.search.Scorer scorer)
               throws IOException
Specified by:
setScorer in class org.apache.lucene.search.Collector
Throws:
IOException

collect

public void collect(int doc)
             throws IOException
Specified by:
collect in class org.apache.lucene.search.Collector
Throws:
IOException

setNextReader

public void setNextReader(org.apache.lucene.index.IndexReader reader,
                          int docBase)
                   throws IOException
Specified by:
setNextReader in class org.apache.lucene.search.Collector
Throws:
IOException

acceptsDocsOutOfOrder

public boolean acceptsDocsOutOfOrder()
Specified by:
acceptsDocsOutOfOrder in class org.apache.lucene.search.Collector

getTopGroups

public TopGroups getTopGroups(int withinGroupOffset)


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