lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Zotter (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SOLR-2463) Using an evaluator outside the scope of an entity results in a null context
Date Fri, 08 Apr 2011 20:49:05 GMT
Using an evaluator outside the scope of an entity results in a null context
---------------------------------------------------------------------------

                 Key: SOLR-2463
                 URL: https://issues.apache.org/jira/browse/SOLR-2463
             Project: Solr
          Issue Type: Bug
          Components: contrib - DataImportHandler
    Affects Versions: 3.1, 3.1.1, 4.0
            Reporter: Robert Zotter
            Priority: Minor


When using an Evaluator outside an entity element the Context argument is null.

public class LowerCaseFunctionEvaluator extends Evaluator {
 public String evaluate(String expression, Context context) {
   List l = EvaluatorBag.parseParams(expression, context.getVariableResolver());
   if (l.size() != 1) {
     throw new RuntimeException("'toLowerCase' must have only one parameter ");
   }

   return l.get(0).toString().toLowerCase();
 }
}

<dataSource   name="..."
              type="..."
              driver="..."
              url="..."
              user="${dataimporter.functions.toLowerCase('THIS_WILL_NOT_WORK')}"
              password="..."
              batchSize="..."/>


 <entity name="..."
            dataSource="..."
            query="select * from ${dataimporter.functions.toLowerCase('THIS_WILL_WORK')}"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message