Module org.apache.lucene.grouping
Class DistinctValuesCollector<T,R>
java.lang.Object
org.apache.lucene.search.SimpleCollector
org.apache.lucene.search.grouping.SecondPassGroupingCollector<T>
org.apache.lucene.search.grouping.DistinctValuesCollector<T,R>
- All Implemented Interfaces:
Collector
,LeafCollector
A second pass grouping collector that keeps track of distinct values for a specified field for
the top N group.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
static class
Returned bygetGroups()
, representing the value and set of distinct values for the group.private static class
-
Field Summary
Fields inherited from class org.apache.lucene.search.grouping.SecondPassGroupingCollector
groupReducer, groups, groupSelector, totalGroupedHitCount, totalHitCount
-
Constructor Summary
ConstructorsConstructorDescriptionDistinctValuesCollector
(GroupSelector<T> groupSelector, Collection<SearchGroup<T>> groups, GroupSelector<R> valueSelector) Create a DistinctValuesCollector -
Method Summary
Modifier and TypeMethodDescriptionReturns all unique values for each top N group.Methods inherited from class org.apache.lucene.search.grouping.SecondPassGroupingCollector
collect, doSetNextReader, getGroupSelector, scoreMode, setScorer
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
collect, competitiveIterator, finish
-
Constructor Details
-
DistinctValuesCollector
public DistinctValuesCollector(GroupSelector<T> groupSelector, Collection<SearchGroup<T>> groups, GroupSelector<R> valueSelector) Create a DistinctValuesCollector- Parameters:
groupSelector
- the group selector to determine the top-level groupsgroups
- the top-level groups to collect forvalueSelector
- a group selector to determine which values to collect per-group
-
-
Method Details
-
getGroups
Returns all unique values for each top N group.- Returns:
- all unique values for each top N group
-