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
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat to do with the current value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract GroupSelector.StateadvanceTo(int doc) Advance the GroupSelector's iterator to the given documentabstract Tabstract TGet the group value of the current documentabstract voidsetGroups(Collection<SearchGroup<T>> groups) Set a restriction on the group values returned by this selectorabstract voidsetNextReader(LeafReaderContext readerContext) Set the LeafReaderContextabstract voidSet 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 ofSearchGroupobjects to limit selections to
-