lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r786465 - in /lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj: SolrServer.java request/UpdateRequest.java
Date Fri, 19 Jun 2009 11:54:44 GMT
Author: noble
Date: Fri Jun 19 11:54:44 2009
New Revision: 786465

URL: http://svn.apache.org/viewvc?rev=786465&view=rev
Log:
SOLR-1222 add convenience methods for deleteById to take a list of strings

Modified:
    lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/SolrServer.java
    lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java

Modified: lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/SolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/SolrServer.java?rev=786465&r1=786464&r2=786465&view=diff
==============================================================================
--- lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/SolrServer.java (original)
+++ lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/SolrServer.java Fri Jun 19 11:54:44
2009
@@ -21,6 +21,7 @@
 import java.io.Serializable;
 import java.util.Collection;
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.solr.client.solrj.request.QueryRequest;
 import org.apache.solr.client.solrj.request.SolrPing;
@@ -101,6 +102,10 @@
     return new UpdateRequest().deleteById( id ).process( this );
   }
 
+  public UpdateResponse deleteById(List<String> ids) throws SolrServerException, IOException
{
+    return new UpdateRequest().deleteById( ids ).process( this );
+  }
+
   public UpdateResponse deleteByQuery(String query) throws SolrServerException, IOException
{
     return new UpdateRequest().deleteByQuery( query ).process( this );
   }

Modified: lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java?rev=786465&r1=786464&r2=786465&view=diff
==============================================================================
--- lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java (original)
+++ lucene/solr/trunk/src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java Fri
Jun 19 11:54:44 2009
@@ -113,6 +113,13 @@
     deleteById.add( id );
     return this;
   }
+  public UpdateRequest deleteById( List<String> ids )
+  {
+    if( deleteById == null ) {
+      deleteById = new ArrayList<String>(ids);
+    }
+    return this;
+  }
   
   public UpdateRequest deleteByQuery( String q )
   {



Mime
View raw message