public abstract class LongValuesSource extends java.lang.Object implements SegmentCacheable
LongValues
To obtain a LongValues
object for a leaf reader, clients should
call rewrite(IndexSearcher)
against the top-level searcher, and
then getValues(LeafReaderContext, DoubleValues)
.
LongValuesSource objects for long and int-valued NumericDocValues fields can
be obtained by calling fromLongField(String)
and fromIntField(String)
.
To obtain a LongValuesSource from a float or double-valued NumericDocValues field,
use DoubleValuesSource.fromFloatField(String)
or DoubleValuesSource.fromDoubleField(String)
and then call DoubleValuesSource.toLongValuesSource()
.Modifier and Type | Class and Description |
---|---|
private static class |
LongValuesSource.ConstantLongValuesSource |
private static class |
LongValuesSource.DoubleLongValuesSource |
private static class |
LongValuesSource.FieldValuesSource |
private static class |
LongValuesSource.LongValuesComparatorSource |
private static class |
LongValuesSource.LongValuesHolder |
private static class |
LongValuesSource.LongValuesSortField |
Constructor and Description |
---|
LongValuesSource() |
Modifier and Type | Method and Description |
---|---|
private static NumericDocValues |
asNumericDocValues(LongValuesSource.LongValuesHolder in) |
static LongValuesSource |
constant(long value)
Creates a LongValuesSource that always returns a constant value
|
abstract boolean |
equals(java.lang.Object obj) |
static LongValuesSource |
fromIntField(java.lang.String field)
Creates a LongValuesSource that wraps an int-valued field
|
static LongValuesSource |
fromLongField(java.lang.String field)
Creates a LongValuesSource that wraps a long-valued field
|
SortField |
getSortField(boolean reverse)
Create a sort field based on the value of this producer
|
abstract LongValues |
getValues(LeafReaderContext ctx,
DoubleValues scores)
Returns a
LongValues instance for the passed-in LeafReaderContext and scores
If scores are not needed to calculate the values (ie returns false , callers
may safely pass null for the scores parameter. |
abstract int |
hashCode() |
abstract boolean |
needsScores()
Return true if document scores are needed to calculate values
|
abstract LongValuesSource |
rewrite(IndexSearcher searcher)
Return a LongValuesSource specialised for the given IndexSearcher
Implementations should assume that this will only be called once.
|
DoubleValuesSource |
toDoubleValuesSource()
Convert to a DoubleValuesSource by casting long values to doubles
|
private static LongValues |
toLongValues(NumericDocValues in) |
abstract java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isCacheable
public abstract LongValues getValues(LeafReaderContext ctx, DoubleValues scores) throws java.io.IOException
LongValues
instance for the passed-in LeafReaderContext and scores
If scores are not needed to calculate the values (ie returns false
, callers
may safely pass null
for the scores
parameter.java.io.IOException
public abstract boolean needsScores()
public abstract int hashCode()
hashCode
in class java.lang.Object
public abstract boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public abstract java.lang.String toString()
toString
in class java.lang.Object
public abstract LongValuesSource rewrite(IndexSearcher searcher) throws java.io.IOException
this
java.io.IOException
public SortField getSortField(boolean reverse)
reverse
- true if the sort should be decreasingpublic DoubleValuesSource toDoubleValuesSource()
public static LongValuesSource fromLongField(java.lang.String field)
public static LongValuesSource fromIntField(java.lang.String field)
public static LongValuesSource constant(long value)
private static LongValues toLongValues(NumericDocValues in)
private static NumericDocValues asNumericDocValues(LongValuesSource.LongValuesHolder in)