Class LongRangeGroupSelector
- java.lang.Object
-
- org.apache.lucene.search.grouping.GroupSelector<LongRange>
-
- org.apache.lucene.search.grouping.LongRangeGroupSelector
-
public class LongRangeGroupSelector extends GroupSelector<LongRange>
A GroupSelector implementation that groups documents by long values
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.GroupSelector
GroupSelector.State
-
-
Constructor Summary
Constructors Constructor Description LongRangeGroupSelector(LongValuesSource source, LongRangeFactory rangeFactory)
Creates a new LongRangeGroupSelector
-
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 documentLongRange
copyValue()
LongRange
currentValue()
Get the group value of the current documentvoid
setGroups(Collection<SearchGroup<LongRange>> 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
-
LongRangeGroupSelector
public LongRangeGroupSelector(LongValuesSource source, LongRangeFactory rangeFactory)
Creates a new LongRangeGroupSelector- Parameters:
source
- a LongValuesSource to retrieve long values per documentrangeFactory
- a LongRangeFactory that defines how to group the long values into range buckets
-
-
Method Detail
-
setNextReader
public void setNextReader(LeafReaderContext readerContext) throws IOException
Description copied from class:GroupSelector
Set the LeafReaderContext- Specified by:
setNextReader
in classGroupSelector<LongRange>
- Throws:
IOException
-
setScorer
public void setScorer(Scorable scorer) throws IOException
Description copied from class:GroupSelector
Set the current Scorer- Specified by:
setScorer
in classGroupSelector<LongRange>
- 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<LongRange>
- Throws:
IOException
-
currentValue
public LongRange currentValue() throws IOException
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<LongRange>
- Throws:
IOException
-
copyValue
public LongRange copyValue() throws IOException
- Specified by:
copyValue
in classGroupSelector<LongRange>
- Returns:
- a copy of the group value of the current document
- Throws:
IOException
-
setGroups
public void setGroups(Collection<SearchGroup<LongRange>> 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<LongRange>
- Parameters:
searchGroups
- a set ofSearchGroup
objects to limit selections to
-
-