Class TermGroupSelector
java.lang.Object
org.apache.lucene.search.grouping.GroupSelector<org.apache.lucene.util.BytesRef>
org.apache.lucene.search.grouping.TermGroupSelector
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 -
Method Summary
Modifier and TypeMethodDescriptionadvanceTo(int doc) Advance the GroupSelector's iterator to the given documentorg.apache.lucene.util.BytesReforg.apache.lucene.util.BytesRefGet the group value of the current documentvoidsetGroups(Collection<SearchGroup<org.apache.lucene.util.BytesRef>> searchGroups) Set a restriction on the group values returned by this selectorvoidsetNextReader(org.apache.lucene.index.LeafReaderContext readerContext) Set the LeafReaderContextvoidsetScorer(org.apache.lucene.search.Scorable scorer) Set the current Scorer
-
Constructor Details
-
TermGroupSelector
Create a new TermGroupSelector- Parameters:
field- the SortedDocValues field to use for grouping
-
-
Method Details
-
setNextReader
public void setNextReader(org.apache.lucene.index.LeafReaderContext readerContext) throws IOException Description copied from class:GroupSelectorSet the LeafReaderContext- Specified by:
setNextReaderin classGroupSelector<org.apache.lucene.util.BytesRef>- Throws:
IOException
-
setScorer
Description copied from class:GroupSelectorSet the current Scorer- Specified by:
setScorerin classGroupSelector<org.apache.lucene.util.BytesRef>- Throws:
IOException
-
advanceTo
Description copied from class:GroupSelectorAdvance the GroupSelector's iterator to the given document- Specified by:
advanceToin classGroupSelector<org.apache.lucene.util.BytesRef>- Throws:
IOException
-
currentValue
public org.apache.lucene.util.BytesRef currentValue()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<org.apache.lucene.util.BytesRef>
-
copyValue
public org.apache.lucene.util.BytesRef copyValue()- Specified by:
copyValuein classGroupSelector<org.apache.lucene.util.BytesRef>- Returns:
- a copy of the group value of the current document
-
setGroups
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<org.apache.lucene.util.BytesRef>- Parameters:
searchGroups- a set ofSearchGroupobjects to limit selections to
-