lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r1603210 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/contrib/ solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/
Date Tue, 17 Jun 2014 16:11:03 GMT
Author: shalin
Date: Tue Jun 17 16:11:03 2014
New Revision: 1603210

URL: http://svn.apache.org/r1603210
Log:
SOLR-6129: DateFormatTransformer doesn't resolve dateTimeFormat

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java
    lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1603210&r1=1603209&r2=1603210&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Tue Jun 17 16:11:03 2014
@@ -117,6 +117,8 @@ Bug Fixes
 * SOLR-6175: DebugComponent throws NPE on shard exceptions when using shards.tolerant.
   (Tomás Fernández Löbbe via shalin)
 
+* SOLR-6129: DateFormatTransformer doesn't resolve dateTimeFormat. (Aaron LaBella via shalin)
+
 Other Changes
 ---------------------
 

Modified: lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java?rev=1603210&r1=1603209&r2=1603210&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java
(original)
+++ lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DateFormatTransformer.java
Tue Jun 17 16:11:03 2014
@@ -58,6 +58,8 @@ public class DateFormatTransformer exten
       String fmt = map.get(DATE_TIME_FMT);
       if (fmt == null)
         continue;
+      VariableResolver resolver = context.getVariableResolver();
+      fmt = resolver.replaceTokens(fmt);
       String column = map.get(DataImporter.COLUMN);
       String srcCol = map.get(RegexTransformer.SRC_COL_NAME);
       if (srcCol == null)

Modified: lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java?rev=1603210&r1=1603209&r2=1603210&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java
(original)
+++ lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java
Tue Jun 17 16:11:03 2014
@@ -38,7 +38,7 @@ public class TestDateFormatTransformer e
     fields.add(createMap(DataImporter.COLUMN, "lastModified"));
     fields.add(createMap(DataImporter.COLUMN,
             "dateAdded", RegexTransformer.SRC_COL_NAME, "lastModified",
-            DateFormatTransformer.DATE_TIME_FMT, "MM/dd/yyyy"));
+            DateFormatTransformer.DATE_TIME_FMT, "${xyz.myDateFormat}"));
 
     SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy", Locale.ROOT);
     Date now = format.parse(format.format(new Date()));
@@ -47,6 +47,7 @@ public class TestDateFormatTransformer e
 
     VariableResolver resolver = new VariableResolver();
     resolver.addNamespace("e", row);
+    resolver.addNamespace("xyz", createMap("myDateFormat", "MM/dd/yyyy"));
 
     Context context = getContext(null, resolver,
             null, Context.FULL_DUMP, fields, null);



Mime
View raw message