Class BooleanExpressionTransformer
java.lang.Object
com.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer<com.yahoo.searchlib.rankingexpression.transform.TransformContext>
com.yahoo.schema.expressiontransforms.BooleanExpressionTransformer
public class BooleanExpressionTransformer
extends com.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer<com.yahoo.searchlib.rankingexpression.transform.TransformContext>
Transforms
a && b into if(a, b, false)
and
a || b into if(a, true, b)
to avoid computing b if a is false and true respectively.
This may increase performance since boolean expressions are not short-circuited.
- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.yahoo.searchlib.rankingexpression.rule.ExpressionNode
transform
(com.yahoo.searchlib.rankingexpression.rule.ExpressionNode node, com.yahoo.searchlib.rankingexpression.transform.TransformContext context) Methods inherited from class com.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer
transform, transformChildren
-
Constructor Details
-
BooleanExpressionTransformer
public BooleanExpressionTransformer()
-
-
Method Details
-
transform
public com.yahoo.searchlib.rankingexpression.rule.ExpressionNode transform(com.yahoo.searchlib.rankingexpression.rule.ExpressionNode node, com.yahoo.searchlib.rankingexpression.transform.TransformContext context) - Specified by:
transform
in classcom.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer<com.yahoo.searchlib.rankingexpression.transform.TransformContext>
-