(11/02/22 6:58), Mark wrote:
I download Solr 4.0 from trunk today and I tried using a custom Evaluator
during my
full/delta-importing.
Within the evaluate method though, the Context is always null? When using this
same class with Solr
1.4.1 the context always exists. Is this a bug or is this behavior expected?
Thanks
public class MyEvaluator extends Evaluator {
@Override
public String evaluate(String argument, Context context) {
// Argument is present however context is always null!
}
}
I tried my test Evaluator on Solr 4.0 and it worked as expected, context is not
null.
What I did on example-DIH is that:
1. add the following tag to db-data-config.xml:
<function name="toLowerCase" class="LowerCaseFunctionEvaluator"/>
2. use the above evaluator:
<entity name="feature"
query="select DESCRIPTION from FEATURE where
ITEM_ID='${dih.functions.toLowerCase(item.ID)}'"
3. do full-import
Mt test evaluator looks like this:
public class LowerCaseFunctionEvaluator extends Evaluator {
public String evaluate(String expression, Context context) {
System.out.println( "***** exp = " + expression );
System.out.println( "***** context = " + context );
return null;
}
}
and the context was not null.
Koji
--
http://www.rondhuit.com/en/