org.apache.lucene.search.grouping
Class TermSecondPassGroupingCollector
java.lang.Object
org.apache.lucene.search.Collector
org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector<String>
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TermSecondPassGroupingCollector
public TermSecondPassGroupingCollector(String groupField,
Collection<SearchGroup<String>> groups,
Sort groupSort,
Sort withinGroupSort,
int maxDocsPerGroup,
boolean getScores,
boolean getMaxScores,
boolean fillSortFields)
throws IOException
- Throws:
IOException
setNextReader
public void setNextReader(IndexReader reader,
int docBase)
throws IOException
- Description copied from class:
Collector
- Called before collecting from each IndexReader. All doc ids in
Collector.collect(int)
will correspond to reader.
Add docBase to the current IndexReaders internal document id to re-base ids
in Collector.collect(int)
.
- Overrides:
setNextReader
in class AbstractSecondPassGroupingCollector<String>
- Parameters:
reader
- next IndexReader
- 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