private static class IndexReaderFunctions.IndexReaderDoubleValuesSource extends DoubleValuesSource
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
description |
private IndexReaderFunctions.ReaderFunction |
func |
SCORES
Modifier | Constructor and Description |
---|---|
private |
IndexReaderDoubleValuesSource(IndexReaderFunctions.ReaderFunction func,
java.lang.String description) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
DoubleValues |
getValues(LeafReaderContext ctx,
DoubleValues scores)
Returns a
DoubleValues 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. |
int |
hashCode() |
boolean |
isCacheable(LeafReaderContext ctx) |
boolean |
needsScores()
Return true if document scores are needed to calculate values
|
DoubleValuesSource |
rewrite(IndexSearcher searcher)
Return a DoubleValuesSource specialised for the given IndexSearcher
Implementations should assume that this will only be called once.
|
java.lang.String |
toString() |
constant, explain, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, toLongValuesSource
private final IndexReaderFunctions.ReaderFunction func
private final java.lang.String description
private IndexReaderDoubleValuesSource(IndexReaderFunctions.ReaderFunction func, java.lang.String description)
public DoubleValues getValues(LeafReaderContext ctx, DoubleValues scores) throws java.io.IOException
DoubleValuesSource
DoubleValues
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.getValues
in class DoubleValuesSource
java.io.IOException
public boolean needsScores()
DoubleValuesSource
needsScores
in class DoubleValuesSource
public DoubleValuesSource rewrite(IndexSearcher searcher) throws java.io.IOException
DoubleValuesSource
this
Queries that use DoubleValuesSource objects should call rewrite() during
Query.createWeight(IndexSearcher, ScoreMode, float)
rather than during
Query.rewrite(IndexReader)
to avoid IndexReader reference leakage.
For the same reason, implementations that cache references to the IndexSearcher
should return a new object from this method.rewrite
in class DoubleValuesSource
java.io.IOException
public java.lang.String toString()
toString
in class DoubleValuesSource
public boolean equals(java.lang.Object o)
equals
in class DoubleValuesSource
public int hashCode()
hashCode
in class DoubleValuesSource
public boolean isCacheable(LeafReaderContext ctx)
true
if the object can be cached against a given leaf