Class DoubleRangeGroupSelector
- java.lang.Object
-
- org.apache.lucene.search.grouping.GroupSelector<DoubleRange>
-
- org.apache.lucene.search.grouping.DoubleRangeGroupSelector
-
public class DoubleRangeGroupSelector extends GroupSelector<DoubleRange>
A GroupSelector implementation that groups documents by double 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 DoubleRangecurrentprivate booleanincludeEmptyprivate java.util.Set<DoubleRange>inSecondPassprivate booleanpositionedprivate DoubleRangeFactoryrangeFactoryprivate DoubleValuesSourcesourceprivate DoubleValuesvalues
-
Constructor Summary
Constructors Constructor Description DoubleRangeGroupSelector(DoubleValuesSource source, DoubleRangeFactory rangeFactory)Creates a new DoubleRangeGroupSelector
-
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 documentDoubleRangecopyValue()DoubleRangecurrentValue()Get the group value of the current document N.B.voidsetGroups(java.util.Collection<SearchGroup<DoubleRange>> 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 DoubleValuesSource source
-
rangeFactory
private final DoubleRangeFactory rangeFactory
-
inSecondPass
private java.util.Set<DoubleRange> inSecondPass
-
includeEmpty
private boolean includeEmpty
-
positioned
private boolean positioned
-
current
private DoubleRange current
-
context
private LeafReaderContext context
-
values
private DoubleValues values
-
-
Constructor Detail
-
DoubleRangeGroupSelector
public DoubleRangeGroupSelector(DoubleValuesSource source, DoubleRangeFactory rangeFactory)
Creates a new DoubleRangeGroupSelector- Parameters:
source- a DoubleValuesSource to retrieve double values per documentrangeFactory- a DoubleRangeFactory that defines how to group the double 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<DoubleRange>- 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<DoubleRange>- 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<DoubleRange>- Throws:
java.io.IOException
-
currentValue
public DoubleRange 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<DoubleRange>- Throws:
java.io.IOException
-
copyValue
public DoubleRange copyValue() throws java.io.IOException
- Specified by:
copyValuein classGroupSelector<DoubleRange>- Returns:
- a copy of the group value of the current document
- Throws:
java.io.IOException
-
setGroups
public void setGroups(java.util.Collection<SearchGroup<DoubleRange>> 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<DoubleRange>- Parameters:
searchGroups- a set ofSearchGroupobjects to limit selections to
-
-