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<Object,Object> context)Create a new ValueSourceGroupSelector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GroupSelector.StateadvanceTo(int doc)Advance the GroupSelector's iterator to the given documentMutableValuecopyValue()MutableValuecurrentValue()Get the group value of the current documentvoidsetGroups(Collection<SearchGroup<MutableValue>> searchGroups)Set a restriction on the group values returned by this selectorvoidsetNextReader(LeafReaderContext readerContext)Set the LeafReaderContextvoidsetScorer(Scorable scorer)Set the current Scorer
-
-
-
Constructor Detail
-
ValueSourceGroupSelector
public ValueSourceGroupSelector(ValueSource valueSource, Map<Object,Object> 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:GroupSelectorSet the LeafReaderContext- Specified by:
setNextReaderin classGroupSelector<MutableValue>- Throws:
IOException
-
setScorer
public void setScorer(Scorable scorer) throws IOException
Description copied from class:GroupSelectorSet the current Scorer- Specified by:
setScorerin classGroupSelector<MutableValue>- Throws:
IOException
-
advanceTo
public GroupSelector.State advanceTo(int doc) throws IOException
Description copied from class:GroupSelectorAdvance the GroupSelector's iterator to the given document- Specified by:
advanceToin classGroupSelector<MutableValue>- Throws:
IOException
-
currentValue
public MutableValue currentValue() throws IOException
Description copied from class:GroupSelectorGet the group value of the current documentN.B. this object may be reused, for a persistent version use
GroupSelector.copyValue()- Specified by:
currentValuein classGroupSelector<MutableValue>- Throws:
IOException
-
copyValue
public MutableValue copyValue()
- Specified by:
copyValuein 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:GroupSelectorSet 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
GroupSelector.advanceTo(int)will returnGroupSelector.State.SKIP- Specified by:
setGroupsin classGroupSelector<MutableValue>- Parameters:
searchGroups- a set ofSearchGroupobjects to limit selections to
-
-