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:12 UTC

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

Author: mvg
Date: Mon May 14 15:07:12 2012
New Revision: 1338240

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

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

Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/CHANGES.txt?rev=1338240&r1=1338239&r2=1338240&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/CHANGES.txt Mon May 14 15:07:12 2012
@@ -21,6 +21,13 @@ Other Changes
 * SOLR-3422: Refactored internal data classes. 
              All entities in data-config.xml must have a name (James Dyer)
 
+==================  3.6.1 ==================
+
+Bug Fixes
+----------------------
+* 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/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java?rev=1338240&r1=1338239&r2=1338240&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java Mon May 14 15:07:12 2012
@@ -110,34 +110,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);