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, variablesFields 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 aDoubleValuesinstance for the passed-in LeafReaderContext and scoresprivate DoubleValuesgetValuesWithCache(LeafReaderContext readerContext, DoubleValues scores, Map<String, DoubleValues> valuesCache) Methods inherited from class org.apache.lucene.expressions.ExpressionValueSource
equals, explain, hashCode, isCacheable, needsScores, rewrite, toString, zeroWhenUnpositionedMethods inherited from class org.apache.lucene.search.DoubleValuesSource
constant, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, similarityToQueryVector, similarityToQueryVector, toLongValuesSource
-
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:DoubleValuesSourceReturns aDoubleValuesinstance for the passed-in LeafReaderContext and scoresIf scores are not needed to calculate the values (ie
returns false, callers may safely passnullfor thescoresparameter.- Overrides:
getValuesin classExpressionValueSource- Throws:
IOException
-
getValuesWithCache
private DoubleValues getValuesWithCache(LeafReaderContext readerContext, DoubleValues scores, Map<String, DoubleValues> valuesCache) throws IOException- Throws:
IOException
-