Package org.apache.lucene.search
Class LongValuesSource.ConstantLongValuesSource
java.lang.Object
org.apache.lucene.search.LongValuesSource
org.apache.lucene.search.LongValuesSource.ConstantLongValuesSource
- All Implemented Interfaces:
SegmentCacheable
- Enclosing class:
- LongValuesSource
A ConstantLongValuesSource that always returns a constant value
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.LongValuesSource
LongValuesSource.ConstantLongValuesSource
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
getValue()
Get the constant value.getValues
(LeafReaderContext ctx, DoubleValues scores) Returns aLongValues
instance for the passed-in LeafReaderContext and scoresint
hashCode()
boolean
boolean
Return true if document scores are needed to calculate valuesrewrite
(IndexSearcher searcher) Return a LongValuesSource specialised for the given IndexSearchertoString()
Methods inherited from class org.apache.lucene.search.LongValuesSource
constant, fromIntField, fromLongField, getSortField, toDoubleValuesSource
-
Method Details
-
getValues
Description copied from class:LongValuesSource
Returns aLongValues
instance for the passed-in LeafReaderContext and scoresIf scores are not needed to calculate the values (ie
returns false
, callers may safely passnull
for thescores
parameter.- Specified by:
getValues
in classLongValuesSource
- Throws:
IOException
-
isCacheable
- Returns:
true
if the object can be cached against a given leaf
-
needsScores
public boolean needsScores()Description copied from class:LongValuesSource
Return true if document scores are needed to calculate values- Specified by:
needsScores
in classLongValuesSource
-
hashCode
public int hashCode()- Specified by:
hashCode
in classLongValuesSource
-
equals
- Specified by:
equals
in classLongValuesSource
-
toString
- Specified by:
toString
in classLongValuesSource
-
rewrite
Description copied from class:LongValuesSource
Return a LongValuesSource specialised for the given IndexSearcherImplementations should assume that this will only be called once. IndexSearcher-independent implementations can just return
this
- Specified by:
rewrite
in classLongValuesSource
- Throws:
IOException
-
getValue
public long getValue()Get the constant value.
-