|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.Collector org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector<GH>
public abstract class AbstractAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCollector.GroupHead>
This collector specializes in collecting the most relevant document (group head) for each group that match the query.
Nested Class Summary | |
---|---|
static class |
AbstractAllGroupHeadsCollector.GroupHead<GROUP_VALUE_TYPE>
Represents a group head. |
protected class |
AbstractAllGroupHeadsCollector.TemporalResult
Contains the result of group head retrieval. |
Field Summary | |
---|---|
protected int |
compIDXEnd
|
protected int[] |
reversed
|
protected AbstractAllGroupHeadsCollector.TemporalResult |
temporalResult
|
Constructor Summary | |
---|---|
protected |
AbstractAllGroupHeadsCollector(int numberOfSorts)
|
Method Summary | |
---|---|
boolean |
acceptsDocsOutOfOrder()
Return true if this collector does not
require the matching docIDs to be delivered in int sort
order (smallest to largest) to Collector.collect(int) . |
void |
collect(int doc)
Called once for every document matching a query, with the unbased document number. |
protected abstract Collection<GH> |
getCollectedGroupHeads()
Returns the collected group heads. |
int |
groupHeadsSize()
|
protected abstract void |
retrieveGroupHeadAndAddIfNotExist(int doc)
Returns the group head and puts it into temporalResult . |
int[] |
retrieveGroupHeads()
|
FixedBitSet |
retrieveGroupHeads(int maxDoc)
|
Methods inherited from class org.apache.lucene.search.Collector |
---|
setNextReader, setScorer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int[] reversed
protected final int compIDXEnd
protected final AbstractAllGroupHeadsCollector.TemporalResult temporalResult
Constructor Detail |
---|
protected AbstractAllGroupHeadsCollector(int numberOfSorts)
Method Detail |
---|
public FixedBitSet retrieveGroupHeads(int maxDoc)
maxDoc
- The maxDoc of the top level IndexReader
.
FixedBitSet
containing all group heads.public int[] retrieveGroupHeads()
public int groupHeadsSize()
protected abstract void retrieveGroupHeadAndAddIfNotExist(int doc) throws IOException
temporalResult
.
If the group head wasn't encountered before then it will be added to the collected group heads.
The AbstractAllGroupHeadsCollector.TemporalResult.stop
property will be true
if the group head wasn't encountered before
otherwise false
.
doc
- The document to retrieve the group head for.
IOException
- If I/O related errors occurprotected abstract Collection<GH> getCollectedGroupHeads()
public void collect(int doc) throws IOException
Collector
Note: This is called in an inner search loop. For good search performance,
implementations of this method should not call Searcher.doc(int)
or
IndexReader.document(int)
on every hit.
Doing so can slow searches by an order of magnitude or more.
collect
in class Collector
IOException
public boolean acceptsDocsOutOfOrder()
Collector
true
if this collector does not
require the matching docIDs to be delivered in int sort
order (smallest to largest) to Collector.collect(int)
.
Most Lucene Query implementations will visit
matching docIDs in order. However, some queries
(currently limited to certain cases of BooleanQuery
) can achieve faster searching if the
Collector
allows them to deliver the
docIDs out of order.
Many collectors don't mind getting docIDs out of
order, so it's important to return true
here.
acceptsDocsOutOfOrder
in class Collector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |