Class GroupSelector<T>
java.lang.Object
org.apache.lucene.search.grouping.GroupSelector<T>
- Type Parameters:
T
- the type of the group value
- Direct Known Subclasses:
DoubleRangeGroupSelector
,LongRangeGroupSelector
,TermGroupSelector
,ValueSourceGroupSelector
Defines a group, for use by grouping collectors
A GroupSelector acts as an iterator over documents. For each segment, clients should call
setNextReader(LeafReaderContext)
, and then advanceTo(int)
for each matching
document.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
What to do with the current value -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract GroupSelector.State
advanceTo
(int doc) Advance the GroupSelector's iterator to the given documentabstract T
abstract T
Get the group value of the current documentabstract void
setGroups
(Collection<SearchGroup<T>> groups) Set a restriction on the group values returned by this selectorabstract void
setNextReader
(LeafReaderContext readerContext) Set the LeafReaderContextabstract void
Set the current Scorer
-
Constructor Details
-
GroupSelector
public GroupSelector()
-
-
Method Details
-
setNextReader
Set the LeafReaderContext- Throws:
IOException
-
setScorer
Set the current Scorer- Throws:
IOException
-
advanceTo
Advance the GroupSelector's iterator to the given document- Throws:
IOException
-
currentValue
Get the group value of the current documentN.B. this object may be reused, for a persistent version use
copyValue()
- Throws:
IOException
-
copyValue
- Returns:
- a copy of the group value of the current document
- Throws:
IOException
-
setGroups
Set a restriction on the group values returned by this selectorIf the selector is positioned on a document whose group value is not contained within this set, then
advanceTo(int)
will returnGroupSelector.State.SKIP
- Parameters:
groups
- a set ofSearchGroup
objects to limit selections to
-