Class ExpressionOptimizer
- java.lang.Object
-
- com.yahoo.searchlib.rankingexpression.evaluation.ExpressionOptimizer
-
public class ExpressionOptimizer extends java.lang.Object
This class will perform various optimizations on the ranking expressions. Clients using optimized expressions will do// Set up once RankingExpression expression = new RankingExpression(myExpressionString); ArrayContext context = new ArrayContext(expression); new ExpressionOptimizer().optimize(expression, context); // Execute repeatedly context.put("featureName1", value1); ... expression.evaluate(context); // Note that the expression may be used by multiple threads at the same time, while the // context is single-threaded. To create a context for another tread, use the above context as a prototype, // contextForOtherThread = context.clone();
Instances of this class are not multithread safe.
- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description ExpressionOptimizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optimizer
getOptimizer(java.lang.Class<?> clazz)
Gets an optimizer instance used by this by class name, or null if the optimizer is not knownOptimizationReport
optimize(RankingExpression expression, AbstractArrayContext arrayContext)
OptimizationReport
optimize(RankingExpression expression, ContextIndex contextIndex)
-
-
-
Method Detail
-
getOptimizer
public Optimizer getOptimizer(java.lang.Class<?> clazz)
Gets an optimizer instance used by this by class name, or null if the optimizer is not known
-
optimize
public OptimizationReport optimize(RankingExpression expression, ContextIndex contextIndex)
-
optimize
public OptimizationReport optimize(RankingExpression expression, AbstractArrayContext arrayContext)
-
-