|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.search.Collector
org.apache.lucene.search.grouping.AbstractFirstPassGroupingCollector<String>
org.apache.lucene.search.grouping.TermFirstPassGroupingCollector
public class TermFirstPassGroupingCollector
Concrete implementation of AbstractFirstPassGroupingCollector that groups based on
field values and more specifically uses FieldCache.StringIndex
to collect groups.
| Constructor Summary | |
|---|---|
TermFirstPassGroupingCollector(String groupField,
Sort groupSort,
int topNGroups)
Create the first pass collector. |
|
| Method Summary | |
|---|---|
protected String |
copyDocGroupValue(String groupValue,
String reuse)
Returns a copy of the specified group value by creating a new instance and copying the value from the specified groupValue in the new instance. |
protected String |
getDocGroupValue(int doc)
Returns the group value for the specified doc. |
void |
setNextReader(IndexReader reader,
int docBase)
Called before collecting from each IndexReader. |
| Methods inherited from class org.apache.lucene.search.grouping.AbstractFirstPassGroupingCollector |
|---|
acceptsDocsOutOfOrder, collect, getTopGroups, setScorer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TermFirstPassGroupingCollector(String groupField,
Sort groupSort,
int topNGroups)
throws IOException
groupField - The field used to group
documents. This field must be single-valued and
indexed (FieldCache is used to access its value
per-document).groupSort - The Sort used to sort the
groups. The top sorted document within each group
according to groupSort, determines how that group
sorts against other groups. This must be non-null,
ie, if you want to groupSort by relevance use
Sort.RELEVANCE.topNGroups - How many top groups to keep.
IOException - When I/O related errors occur| Method Detail |
|---|
protected String getDocGroupValue(int doc)
AbstractFirstPassGroupingCollector
getDocGroupValue in class AbstractFirstPassGroupingCollector<String>doc - The specified doc
protected String copyDocGroupValue(String groupValue,
String reuse)
AbstractFirstPassGroupingCollector
copyDocGroupValue in class AbstractFirstPassGroupingCollector<String>groupValue - The group value to copyreuse - Optionally a reuse instance to prevent a new instance creation
public void setNextReader(IndexReader reader,
int docBase)
throws IOException
CollectorCollector.collect(int) will correspond to reader.
Add docBase to the current IndexReaders internal document id to re-base ids
in Collector.collect(int).
setNextReader in class AbstractFirstPassGroupingCollector<String>reader - next IndexReader
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||