use of org.apache.solr.client.solrj.io.stream.expr.StreamExpression in project lucene-solr by apache.
the class EchoStream method toExpression.
private StreamExpression toExpression(StreamFactory factory, boolean includeStreams) throws IOException {
// function name
StreamExpression expression = new StreamExpression(factory.getFunctionName(this.getClass()));
expression.addParameter("\"" + echo.replace("\"", "\\\"") + "\"");
return expression;
}
use of org.apache.solr.client.solrj.io.stream.expr.StreamExpression in project lucene-solr by apache.
the class ClassifyStream method toExpression.
private StreamExpression toExpression(StreamFactory factory, boolean includeStreams) throws IOException {
// function name
StreamExpression expression = new StreamExpression(factory.getFunctionName(this.getClass()));
if (includeStreams) {
if (docStream instanceof Expressible && modelStream instanceof Expressible) {
expression.addParameter(((Expressible) modelStream).toExpression(factory));
expression.addParameter(((Expressible) docStream).toExpression(factory));
} else {
throw new IOException("This ClassifyStream contains a non-expressible TupleStream - it cannot be converted to an expression");
}
}
expression.addParameter(new StreamExpressionNamedParameter("field", field));
expression.addParameter(new StreamExpressionNamedParameter("analyzerField", analyzerField));
return expression;
}
Aggregations