You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2012/08/13 12:07:32 UTC

svn commit: r1372351 - in /lucene/dev/branches/branch_4x/solr: ./ cloud-dev/ contrib/ core/ core/src/java/org/apache/solr/handler/loader/ dev-tools/ example/ lib/ licenses/ scripts/ solrj/ solrj/src/test/org/apache/solr/client/solrj/ test-framework/ we...

Author: siren
Date: Mon Aug 13 10:07:31 2012
New Revision: 1372351

URL: http://svn.apache.org/viewvc?rev=1372351&view=rev
Log:
SOLR-3649: fix bug in JavabinLoader that caused deleteById(List<String> ids) to not work in SolrJ. merge from trunk (r1372346)

Modified:
    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/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/README.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/cloud-dev/   (props changed)
    lucene/dev/branches/branch_4x/solr/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java
    lucene/dev/branches/branch_4x/solr/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/solr/example/   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/scripts/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
    lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/solr/testlogging.properties   (props changed)
    lucene/dev/branches/branch_4x/solr/webapp/   (props changed)

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1372351&r1=1372350&r2=1372351&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Mon Aug 13 10:07:31 2012
@@ -47,6 +47,9 @@ Bug Fixes
 * SOLR-3725: Fixed package-local-src-tgz target to not bring in unnecessary jars
   and binary contents.  (Michael Dodsworth via rmuir)
 
+* SOLR-3649: Fixed bug in JavabinLoader that caused deleteById(List<String> ids)
+  to not work in SolrJ (siren)
+
 ==================  4.0.0-BETA ===================
 
 

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java?rev=1372351&r1=1372350&r2=1372351&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JavabinLoader.java Mon Aug 13 10:07:31 2012
@@ -122,8 +122,8 @@ public class JavabinLoader extends Conte
       for (String s : update.getDeleteById()) {
         delcmd.id = s;
         processor.processDelete(delcmd);
+        delcmd.clear();
       }
-      delcmd.id = null;
     }
     
     if(update.getDeleteQuery() != null) {

Modified: lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java?rev=1372351&r1=1372350&r2=1372351&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java (original)
+++ lucene/dev/branches/branch_4x/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java Mon Aug 13 10:07:31 2012
@@ -711,16 +711,11 @@ abstract public class SolrExampleTests e
     assertNumFound( "*:*", 3 ); // make sure it got in
     
     // should be able to handle multiple delete commands in a single go
-    StringWriter xml = new StringWriter();
-    xml.append( "<delete>" );
+    List<String> ids = new ArrayList<String>();
     for( SolrInputDocument d : doc ) {
-      xml.append( "<id>" );
-      XML.escapeCharData( (String)d.getField( "id" ).getFirstValue(), xml );
-      xml.append( "</id>" );
+      ids.add(d.getFieldValue("id").toString());
     }
-    xml.append( "</delete>" );
-    DirectXmlRequest up = new DirectXmlRequest( "/update", xml.toString() );
-    server.request( up );
+    server.deleteById(ids);
     server.commit();
     assertNumFound( "*:*", 0 ); // make sure it got out
   }