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
This expression value source shares one value cache when generating
ExpressionFunctionValues
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
ConstructorsConstructorDescriptionCachingExpressionValueSource
(Bindings bindings, Expression expression) CachingExpressionValueSource
(ExpressionValueSource expressionValueSource) CachingExpressionValueSource
(DoubleValuesSource[] variables, Expression expression, boolean needsScores) -
Method Summary
Modifier and TypeMethodDescriptiongetValues
(LeafReaderContext readerContext, DoubleValues scores) Returns aDoubleValues
instance for the passed-in LeafReaderContext and scoresprivate DoubleValues
getValuesWithCache
(LeafReaderContext readerContext, DoubleValues scores, Map<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, similarityToQueryVector, similarityToQueryVector, toLongValuesSource, toSortableLongDoubleValuesSource
-
Constructor Details
-
CachingExpressionValueSource
CachingExpressionValueSource(Bindings bindings, Expression expression) -
CachingExpressionValueSource
CachingExpressionValueSource(DoubleValuesSource[] variables, Expression expression, boolean needsScores) -
CachingExpressionValueSource
-
-
Method Details
-
getValues
public DoubleValues getValues(LeafReaderContext readerContext, DoubleValues scores) throws IOException Description copied from class:DoubleValuesSource
Returns aDoubleValues
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.- Overrides:
getValues
in classExpressionValueSource
- Throws:
IOException
-
getValuesWithCache
private DoubleValues getValuesWithCache(LeafReaderContext readerContext, DoubleValues scores, Map<String, DoubleValues> valuesCache) throws IOException- Throws:
IOException
-