use of com.yahoo.vespa.indexinglanguage.ExpressionConverter in project vespa by vespa-engine.
the class TextMatch method process.
@Override
public void process(boolean validate) {
for (SDField field : search.allConcreteFields()) {
if (field.getMatching().getType() != Matching.Type.TEXT)
continue;
ScriptExpression script = field.getIndexingScript();
if (script == null)
continue;
DataType fieldType = field.getDataType();
if (fieldType instanceof CollectionDataType) {
fieldType = ((CollectionDataType) fieldType).getNestedType();
}
if (fieldType != DataType.STRING)
continue;
Set<String> dynamicSummary = new TreeSet<>();
Set<String> staticSummary = new TreeSet<>();
new IndexingOutputs(search, deployLogger, rankProfileRegistry, queryProfiles).findSummaryTo(search, field, dynamicSummary, staticSummary);
MyVisitor visitor = new MyVisitor(dynamicSummary);
visitor.visit(script);
if (!visitor.requiresTokenize)
continue;
ExpressionConverter converter = new MyStringTokenizer(search, findAnnotatorConfig(search, field));
field.setIndexingScript((ScriptExpression) converter.convert(script));
}
}
use of com.yahoo.vespa.indexinglanguage.ExpressionConverter in project vespa by vespa-engine.
the class PredicateProcessor method addPredicateOptimizationIlScript.
private void addPredicateOptimizationIlScript(SDField field, BooleanIndexDefinition booleanIndexDefiniton) {
Expression script = field.getIndexingScript();
if (script == null)
return;
script = new StatementExpression(makeSetPredicateVariablesScript(booleanIndexDefiniton), script);
ExpressionConverter converter = new PredicateOutputTransformer(search);
field.setIndexingScript(new ScriptExpression((StatementExpression) converter.convert(script)));
}
Aggregations