Class AllGroupsCollector<T>
java.lang.Object
org.apache.lucene.search.SimpleCollector
org.apache.lucene.search.grouping.AllGroupsCollector<T>
- All Implemented Interfaces:
Collector
,LeafCollector
A collector that collects all groups that match the query. Only the group value is collected, and
the order is undefined. This collector does not determine the most relevant document of a group.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorDescriptionAllGroupsCollector
(GroupSelector<T> groupSelector) Create a new AllGroupsCollector -
Method Summary
Modifier and TypeMethodDescriptionvoid
collect
(int doc) protected void
doSetNextReader
(LeafReaderContext context) int
Returns the total number of groups for the executed search.Returns the group valuesvoid
Methods inherited from class org.apache.lucene.search.SimpleCollector
getLeafCollector
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.search.LeafCollector
competitiveIterator
-
Constructor Details
-
AllGroupsCollector
Create a new AllGroupsCollector- Parameters:
groupSelector
- the GroupSelector to determine groups
-
-
Method Details
-
getGroupCount
public int getGroupCount()Returns the total number of groups for the executed search. This is a convenience method. The following code snippet has the same effect:getGroups().size()
- Returns:
- The total number of groups for the executed search
-
getGroups
Returns the group valuesThis is an unordered collections of group values.
- Returns:
- the group values
-
setScorer
- Specified by:
setScorer
in interfaceLeafCollector
- Overrides:
setScorer
in classSimpleCollector
- Throws:
IOException
-
doSetNextReader
- Overrides:
doSetNextReader
in classSimpleCollector
- Throws:
IOException
-
collect
- Specified by:
collect
in interfaceLeafCollector
- Specified by:
collect
in classSimpleCollector
- Throws:
IOException
-
scoreMode
-