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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 class com.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer<com.yahoo.searchlib.rankingexpression.transform.TransformContext>