Search in sources :

Example 16 with StreamOperation

use of org.apache.solr.client.solrj.io.ops.StreamOperation in project lucene-solr by apache.

the class ConcatOperationTest method concatSingleField.

@Test
public void concatSingleField() throws Exception {
    Tuple tuple;
    StreamOperation operation;
    operation = new ConcatOperation(new String[] { "fieldA" }, "fieldAConcat", "-");
    values.clear();
    values.put("fieldA", "bar");
    tuple = new Tuple(values);
    operation.operate(tuple);
    Assert.assertNotNull(tuple.get("fieldA"));
    Assert.assertEquals("bar", tuple.get("fieldA"));
    Assert.assertNotNull(tuple.get("fieldAConcat"));
    Assert.assertEquals("bar", tuple.get("fieldAConcat"));
}
Also used : ConcatOperation(org.apache.solr.client.solrj.io.ops.ConcatOperation) StreamOperation(org.apache.solr.client.solrj.io.ops.StreamOperation) Tuple(org.apache.solr.client.solrj.io.Tuple) Test(org.junit.Test)

Aggregations

Tuple (org.apache.solr.client.solrj.io.Tuple)16 StreamOperation (org.apache.solr.client.solrj.io.ops.StreamOperation)16 Test (org.junit.Test)15 ConcatOperation (org.apache.solr.client.solrj.io.ops.ConcatOperation)8 ReplaceOperation (org.apache.solr.client.solrj.io.ops.ReplaceOperation)7 HashMap (java.util.HashMap)1 Map (java.util.Map)1 StreamEvaluator (org.apache.solr.client.solrj.io.eval.StreamEvaluator)1