From 2169e473bb3344ad56b4d77cf158349e6cad18cb Mon Sep 17 00:00:00 2001 From: Timothy Potter Date: Wed, 16 Jul 2014 01:17:23 +0000 Subject: [PATCH] SOLR-2245: Don't use the default date from dataimport.properties and remove duplicated entry in mail-data-config.xml git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1610893 13f79535-47bb-0310-9956-ffa450edef68 --- .../solr/handler/dataimport/MailEntityProcessor.java | 9 +++++++++ .../example-DIH/solr/mail/conf/mail-data-config.xml | 12 ------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/solr/contrib/dataimporthandler-extras/src/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java b/solr/contrib/dataimporthandler-extras/src/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java index e1c5e37f4ce..9342c0b0a58 100644 --- a/solr/contrib/dataimporthandler-extras/src/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java +++ b/solr/contrib/dataimporthandler-extras/src/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java @@ -108,10 +108,19 @@ public class MailEntityProcessor extends EntityProcessorBase { String varName = ConfigNameConstants.IMPORTER_NS_SHORT + "." + cname + "." + DocBuilder.LAST_INDEX_TIME; Object varValue = context.getVariableResolver().resolve(varName); + if ("1970-01-01 00:00:00".equals(varValue) && + !"".equals(getStringFromContext("fetchMailsSince", ""))) { + // favor fetchMailsSince in this case because the value from + // dataimport.properties is the default/init value + varValue = getStringFromContext("fetchMailsSince", ""); + } + + LOG.info(varName+"="+varValue); if (varValue == null || "".equals(varValue)) { varName = ConfigNameConstants.IMPORTER_NS_SHORT + "." + DocBuilder.LAST_INDEX_TIME; varValue = context.getVariableResolver().resolve(varName); + LOG.info(varName+"="+varValue); } if (varValue != null && varValue instanceof String) { diff --git a/solr/example/example-DIH/solr/mail/conf/mail-data-config.xml b/solr/example/example-DIH/solr/mail/conf/mail-data-config.xml index 6448f6a9bb5..736aea7cc99 100644 --- a/solr/example/example-DIH/solr/mail/conf/mail-data-config.xml +++ b/solr/example/example-DIH/solr/mail/conf/mail-data-config.xml @@ -10,15 +10,3 @@ name="mail_entity"/> - - - - - -