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.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Returned bygetGroups()
, representing the value and set of distinct values for the group. -
Field Summary
Fields inherited from class org.apache.lucene.search.grouping.SecondPassGroupingCollector
groupReducer, groups, groupSelector, totalGroupedHitCount, totalHitCount
-
Constructor Summary
ConstructorDescriptionDistinctValuesCollector
(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
-