Package org.apache.lucene.expressions
Class CachingExpressionValueSource
- java.lang.Object
-
- org.apache.lucene.search.DoubleValuesSource
-
- org.apache.lucene.expressions.ExpressionValueSource
-
- org.apache.lucene.expressions.CachingExpressionValueSource
-
- All Implemented Interfaces:
SegmentCacheable
final class CachingExpressionValueSource extends ExpressionValueSource
This expression value source shares one value cache when generatingExpressionFunctionValues
such that only one value along the whole generation tree is corresponding to one name
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.expressions.ExpressionValueSource
expression, needsScores, variables
-
Fields inherited from class org.apache.lucene.search.DoubleValuesSource
SCORES
-
-
Constructor Summary
Constructors Constructor Description CachingExpressionValueSource(Bindings bindings, Expression expression)
CachingExpressionValueSource(ExpressionValueSource expressionValueSource)
CachingExpressionValueSource(DoubleValuesSource[] variables, Expression expression, boolean needsScores)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleValues
getValues(LeafReaderContext readerContext, DoubleValues scores)
Returns aDoubleValues
instance for the passed-in LeafReaderContext and scores If scores are not needed to calculate the values (iereturns false
, callers may safely passnull
for thescores
parameter.private DoubleValues
getValuesWithCache(LeafReaderContext readerContext, DoubleValues scores, java.util.Map<java.lang.String,DoubleValues> valuesCache)
-
Methods inherited from class org.apache.lucene.expressions.ExpressionValueSource
equals, explain, hashCode, isCacheable, needsScores, rewrite, toString, zeroWhenUnpositioned
-
Methods inherited from class org.apache.lucene.search.DoubleValuesSource
constant, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, toLongValuesSource
-
-
-
-
Constructor Detail
-
CachingExpressionValueSource
CachingExpressionValueSource(Bindings bindings, Expression expression)
-
CachingExpressionValueSource
CachingExpressionValueSource(DoubleValuesSource[] variables, Expression expression, boolean needsScores)
-
CachingExpressionValueSource
public CachingExpressionValueSource(ExpressionValueSource expressionValueSource)
-
-
Method Detail
-
getValues
public DoubleValues getValues(LeafReaderContext readerContext, DoubleValues scores) throws java.io.IOException
Description copied from class:DoubleValuesSource
Returns aDoubleValues
instance for the passed-in LeafReaderContext and scores If scores are not needed to calculate the values (iereturns false
, callers may safely passnull
for thescores
parameter.- Overrides:
getValues
in classExpressionValueSource
- Throws:
java.io.IOException
-
getValuesWithCache
private DoubleValues getValuesWithCache(LeafReaderContext readerContext, DoubleValues scores, java.util.Map<java.lang.String,DoubleValues> valuesCache) throws java.io.IOException
- Throws:
java.io.IOException
-
-