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
-
-
Field Summary
Fields Modifier and Type Field Description private LeafReaderContextcontextprivate LongRangecurrentprivate booleanincludeEmptyprivate java.util.Set<LongRange>inSecondPassprivate booleanpositionedprivate LongRangeFactoryrangeFactoryprivate LongValuesSourcesourceprivate LongValuesvalues
-
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.StateadvanceTo(int doc)Advance the GroupSelector's iterator to the given documentLongRangecopyValue()LongRangecurrentValue()Get the group value of the current document N.B.voidsetGroups(java.util.Collection<SearchGroup<LongRange>> 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.SKIPvoidsetNextReader(LeafReaderContext readerContext)Set the LeafReaderContextvoidsetScorer(Scorable scorer)Set the current Scorer
-
-
-
Field Detail
-
source
private final LongValuesSource source
-
rangeFactory
private final LongRangeFactory rangeFactory
-
inSecondPass
private java.util.Set<LongRange> inSecondPass
-
includeEmpty
private boolean includeEmpty
-
positioned
private boolean positioned
-
current
private LongRange current
-
context
private LeafReaderContext context
-
values
private LongValues values
-
-
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 java.io.IOException
Description copied from class:GroupSelectorSet the LeafReaderContext- Specified by:
setNextReaderin classGroupSelector<LongRange>- Throws:
java.io.IOException
-
setScorer
public void setScorer(Scorable scorer) throws java.io.IOException
Description copied from class:GroupSelectorSet the current Scorer- Specified by:
setScorerin classGroupSelector<LongRange>- Throws:
java.io.IOException
-
advanceTo
public GroupSelector.State advanceTo(int doc) throws java.io.IOException
Description copied from class:GroupSelectorAdvance the GroupSelector's iterator to the given document- Specified by:
advanceToin classGroupSelector<LongRange>- Throws:
java.io.IOException
-
currentValue
public LongRange currentValue() throws java.io.IOException
Description copied from class:GroupSelectorGet the group value of the current document N.B. this object may be reused, for a persistent version useGroupSelector.copyValue()- Specified by:
currentValuein classGroupSelector<LongRange>- Throws:
java.io.IOException
-
copyValue
public LongRange copyValue() throws java.io.IOException
- Specified by:
copyValuein classGroupSelector<LongRange>- Returns:
- a copy of the group value of the current document
- Throws:
java.io.IOException
-
setGroups
public void setGroups(java.util.Collection<SearchGroup<LongRange>> searchGroups)
Description copied from class:GroupSelectorSet 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:
setGroupsin classGroupSelector<LongRange>- Parameters:
searchGroups- a set ofSearchGroupobjects to limit selections to
-
-