lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r886731 - /lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/RegexTransformer.java
Date Thu, 03 Dec 2009 10:21:40 GMT
Author: noble
Date: Thu Dec  3 10:21:38 2009
New Revision: 886731

URL: http://svn.apache.org/viewvc?rev=886731&view=rev
Log:
use Context#replaceTokens directly

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/RegexTransformer.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/RegexTransformer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/RegexTransformer.java?rev=886731&r1=886730&r2=886731&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/RegexTransformer.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/RegexTransformer.java
Thu Dec  3 10:21:38 2009
@@ -44,18 +44,14 @@
 
   @SuppressWarnings("unchecked")
   public Map<String, Object> transformRow(Map<String, Object> row,
-                                          Context context) {
-    VariableResolver vr = context.getVariableResolver();
-    List<Map<String, String>> fields = context.getAllEntityFields();
+                                          Context ctx) {
+    List<Map<String, String>> fields = ctx.getAllEntityFields();
     for (Map<String, String> field : fields) {
       String col = field.get(DataImporter.COLUMN);
-      String reStr = field.get(REGEX);
-      reStr = vr.replaceTokens(reStr);
-      String splitBy = field.get(SPLIT_BY);
-      splitBy =  vr.replaceTokens(splitBy);
-      String replaceWith = field.get(REPLACE_WITH);
-      replaceWith = vr.replaceTokens(replaceWith);
-      String groupNames = vr.replaceTokens(field.get(GROUP_NAMES));
+      String reStr = ctx.replaceTokens(field.get(REGEX));
+      String splitBy = ctx.replaceTokens(field.get(SPLIT_BY));
+      String replaceWith = ctx.replaceTokens(field.get(REPLACE_WITH));
+      String groupNames = ctx.replaceTokens(field.get(GROUP_NAMES));
       if (reStr != null || splitBy != null) {
         String srcColName = field.get(SRC_COL_NAME);
         if (srcColName == null) {



Mime
View raw message