Search in sources :

Example 1 with ExpressionOptimizer

use of com.yahoo.vespa.indexinglanguage.ExpressionOptimizer in project vespa by vespa-engine.

the class OptimizeIlscript method process.

@Override
public void process(boolean validate) {
    for (SDField field : search.allConcreteFields()) {
        ScriptExpression script = field.getIndexingScript();
        if (script == null)
            continue;
        field.setIndexingScript((ScriptExpression) new ExpressionOptimizer().convert(script));
        if (!field.getIndexingScript().toString().equals(script.toString())) {
            warn(search, field, "Rewrote ilscript from:\n" + script.toString() + "\nto\n" + field.getIndexingScript().toString());
        }
    }
}
Also used : SDField(com.yahoo.searchdefinition.document.SDField) ExpressionOptimizer(com.yahoo.vespa.indexinglanguage.ExpressionOptimizer) ScriptExpression(com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression)

Aggregations

SDField (com.yahoo.searchdefinition.document.SDField)1 ExpressionOptimizer (com.yahoo.vespa.indexinglanguage.ExpressionOptimizer)1 ScriptExpression (com.yahoo.vespa.indexinglanguage.expressions.ScriptExpression)1