Class ValueSourceGroupSelector
- java.lang.Object
-
- org.apache.lucene.search.grouping.GroupSelector<MutableValue>
-
- org.apache.lucene.search.grouping.ValueSourceGroupSelector
-
public class ValueSourceGroupSelector extends GroupSelector<MutableValue>
A GroupSelector that groups via a ValueSource
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.GroupSelector
GroupSelector.State
-
-
Constructor Summary
Constructors Constructor Description ValueSourceGroupSelector(ValueSource valueSource, Map<?,?> context)
Create a new ValueSourceGroupSelector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GroupSelector.State
advanceTo(int doc)
Advance the GroupSelector's iterator to the given documentMutableValue
copyValue()
MutableValue
currentValue()
Get the group value of the current document N.B.void
setGroups(Collection<SearchGroup<MutableValue>> searchGroups)
Set a restriction on the group values returned by this selector If the selector is positioned on a document whose group value is not contained within this set, thenGroupSelector.advanceTo(int)
will returnGroupSelector.State.SKIP
void
setNextReader(LeafReaderContext readerContext)
Set the LeafReaderContext
-
-
-
Constructor Detail
-
ValueSourceGroupSelector
public ValueSourceGroupSelector(ValueSource valueSource, Map<?,?> context)
Create a new ValueSourceGroupSelector- Parameters:
valueSource
- the ValueSource to group bycontext
- a context map for the ValueSource
-
-
Method Detail
-
setNextReader
public void setNextReader(LeafReaderContext readerContext) throws IOException
Description copied from class:GroupSelector
Set the LeafReaderContext- Specified by:
setNextReader
in classGroupSelector<MutableValue>
- Throws:
IOException
-
advanceTo
public GroupSelector.State advanceTo(int doc) throws IOException
Description copied from class:GroupSelector
Advance the GroupSelector's iterator to the given document- Specified by:
advanceTo
in classGroupSelector<MutableValue>
- Throws:
IOException
-
currentValue
public MutableValue currentValue()
Description copied from class:GroupSelector
Get the group value of the current document N.B. this object may be reused, for a persistent version useGroupSelector.copyValue()
- Specified by:
currentValue
in classGroupSelector<MutableValue>
-
copyValue
public MutableValue copyValue()
- Specified by:
copyValue
in classGroupSelector<MutableValue>
- Returns:
- a copy of the group value of the current document
-
setGroups
public void setGroups(Collection<SearchGroup<MutableValue>> searchGroups)
Description copied from class:GroupSelector
Set a restriction on the group values returned by this selector If the selector is positioned on a document whose group value is not contained within this set, thenGroupSelector.advanceTo(int)
will returnGroupSelector.State.SKIP
- Specified by:
setGroups
in classGroupSelector<MutableValue>
- Parameters:
searchGroups
- a set ofSearchGroup
objects to limit selections to
-
-