You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mv...@apache.org on 2012/05/14 17:07:36 UTC

svn commit: r1338241 - in /lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler: CHANGES.txt src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java

Author: mvg
Date: Mon May 14 15:07:36 2012
New Revision: 1338241

URL: http://svn.apache.org/viewvc?rev=1338241&view=rev
Log:
SOLR-3336: SolrEntityProcessor substitutes most variables at query time

Modified:
    lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/CHANGES.txt
    lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java

Modified: lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/CHANGES.txt?rev=1338241&r1=1338240&r2=1338241&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/CHANGES.txt Mon May 14 15:07:36 2012
@@ -18,6 +18,9 @@ Bug Fixes
 * SOLR-3430: Added a new test against a real SQL database.  Fixed problems revealed by this new test
              related to the expanded cache support added to 3.6/SOLR-2382 (James Dyer)
 
+* SOLR-3336: SolrEntityProcessor substitutes most variables at query time.
+             (Michael Kroh, Lance Norskog, via Martijn van Groningen)
+
 ==================  3.6.0 ==================
 
 New Features

Modified: lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java?rev=1338241&r1=1338240&r2=1338241&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java (original)
+++ lucene/dev/branches/lucene_solr_3_6/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java Mon May 14 15:07:36 2012
@@ -108,34 +108,6 @@ public class SolrEntityProcessor extends
     } catch (MalformedURLException e) {
       throw new DataImportHandlerException(DataImportHandlerException.SEVERE, e);
     }
-
-    this.queryString = context.getResolvedEntityAttribute(QUERY);
-    if (this.queryString == null) {
-      throw new DataImportHandlerException(
-          DataImportHandlerException.SEVERE,
-          "SolrEntityProcessor: parameter 'query' is required"
-      );
-    }
-    
-    String rowsP = context.getResolvedEntityAttribute(CommonParams.ROWS);
-    if (rowsP != null) {
-      rows = Integer.parseInt(rowsP);
-    }
-    
-    String fqAsString = context.getResolvedEntityAttribute(CommonParams.FQ);
-    if (fqAsString != null) {
-      this.filterQueries = fqAsString.split(",");
-    }
-    
-    String fieldsAsString = context.getResolvedEntityAttribute(CommonParams.FL);
-    if (fieldsAsString != null) {
-      this.fields = fieldsAsString.split(",");
-    }
-    this.queryType = context.getResolvedEntityAttribute(CommonParams.QT);
-    String timeoutAsString = context.getResolvedEntityAttribute(TIMEOUT);
-    if (timeoutAsString != null) {
-      this.timeout = Integer.parseInt(timeoutAsString);
-    }
   }
   
   @Override
@@ -176,6 +148,34 @@ public class SolrEntityProcessor extends
   }
   
   protected SolrDocumentList doQuery(int start) {
+    this.queryString = context.getResolvedEntityAttribute(QUERY);
+    if (this.queryString == null) {
+      throw new DataImportHandlerException(
+          DataImportHandlerException.SEVERE,
+          "SolrEntityProcessor: parameter 'query' is required"
+      );
+    }
+
+    String rowsP = context.getResolvedEntityAttribute(CommonParams.ROWS);
+    if (rowsP != null) {
+      rows = Integer.parseInt(rowsP);
+    }
+
+    String fqAsString = context.getResolvedEntityAttribute(CommonParams.FQ);
+    if (fqAsString != null) {
+      this.filterQueries = fqAsString.split(",");
+    }
+
+    String fieldsAsString = context.getResolvedEntityAttribute(CommonParams.FL);
+    if (fieldsAsString != null) {
+      this.fields = fieldsAsString.split(",");
+    }
+    this.queryType = context.getResolvedEntityAttribute(CommonParams.QT);
+    String timeoutAsString = context.getResolvedEntityAttribute(TIMEOUT);
+    if (timeoutAsString != null) {
+      this.timeout = Integer.parseInt(timeoutAsString);
+    }
+
     SolrQuery solrQuery = new SolrQuery(queryString);
     solrQuery.setRows(rows);
     solrQuery.setStart(start);