Class TermGroupSelector
- java.lang.Object
-
- org.apache.lucene.search.grouping.GroupSelector<BytesRef>
-
- org.apache.lucene.search.grouping.TermGroupSelector
-
public class TermGroupSelector extends GroupSelector<BytesRef>
A GroupSelector implementation that groups via SortedDocValues
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.GroupSelector
GroupSelector.State
-
-
Constructor Summary
Constructors Constructor Description TermGroupSelector(String field)
Create a new TermGroupSelector
-
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 documentBytesRef
copyValue()
BytesRef
currentValue()
Get the group value of the current documentvoid
setGroups(Collection<SearchGroup<BytesRef>> searchGroups)
Set a restriction on the group values returned by this selectorvoid
setNextReader(LeafReaderContext readerContext)
Set the LeafReaderContextvoid
setScorer(Scorable scorer)
Set the current Scorer
-
-
-
Constructor Detail
-
TermGroupSelector
public TermGroupSelector(String field)
Create a new TermGroupSelector- Parameters:
field
- the SortedDocValues field to use for grouping
-
-
Method Detail
-
setNextReader
public void setNextReader(LeafReaderContext readerContext) throws IOException
Description copied from class:GroupSelector
Set the LeafReaderContext- Specified by:
setNextReader
in classGroupSelector<BytesRef>
- Throws:
IOException
-
setScorer
public void setScorer(Scorable scorer) throws IOException
Description copied from class:GroupSelector
Set the current Scorer- Specified by:
setScorer
in classGroupSelector<BytesRef>
- 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<BytesRef>
- Throws:
IOException
-
currentValue
public BytesRef currentValue()
Description copied from class:GroupSelector
Get the group value of the current documentN.B. this object may be reused, for a persistent version use
GroupSelector.copyValue()
- Specified by:
currentValue
in classGroupSelector<BytesRef>
-
copyValue
public BytesRef copyValue()
- Specified by:
copyValue
in classGroupSelector<BytesRef>
- Returns:
- a copy of the group value of the current document
-
setGroups
public void setGroups(Collection<SearchGroup<BytesRef>> searchGroups)
Description copied from class:GroupSelector
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
GroupSelector.advanceTo(int)
will returnGroupSelector.State.SKIP
- Specified by:
setGroups
in classGroupSelector<BytesRef>
- Parameters:
searchGroups
- a set ofSearchGroup
objects to limit selections to
-
-