lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Maritato (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SOLR-1222) add convenience methods for deleteById to take a list of strings
Date Tue, 16 Jun 2009 18:05:08 GMT

    [ https://issues.apache.org/jira/browse/SOLR-1222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12720267#action_12720267
] 

Frank Maritato commented on SOLR-1222:
--------------------------------------

For some reason, I cannot attach a file to this ticket so i will paste the diff here:

Index: src/solrj/org/apache/solr/client/solrj/SolrServer.java
===================================================================
--- src/solrj/org/apache/solr/client/solrj/SolrServer.java  (revision 784856)
+++ src/solrj/org/apache/solr/client/solrj/SolrServer.java  (working copy)
@@ -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;
@@ -97,6 +98,9 @@
     return new UpdateRequest().rollback().process( this );
   }
   
+  public UpdateResponse deleteById(List<String> ids) throws SolrServerException, IOException
{
+    return new UpdateRequest().deleteById( ids ).process( this );
+  }
   public UpdateResponse deleteById(String id) throws SolrServerException, IOException {
     return new UpdateRequest().deleteById( id ).process( this );
   }
Index: src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java
===================================================================
--- src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java (revision 784856)
+++ src/solrj/org/apache/solr/client/solrj/request/UpdateRequest.java (working copy)
@@ -105,6 +105,14 @@
     return this;
   }
   
+  public UpdateRequest deleteById( List<String> ids )
+  {
+    if( deleteById == null ) {
+      deleteById = new ArrayList<String>();
+    }
+    deleteById.addAll( ids );
+    return this;
+  }
   public UpdateRequest deleteById( String id )
   {
     if( deleteById == null ) {


> add convenience methods for deleteById to take a list of strings
> ----------------------------------------------------------------
>
>                 Key: SOLR-1222
>                 URL: https://issues.apache.org/jira/browse/SOLR-1222
>             Project: Solr
>          Issue Type: Improvement
>          Components: clients - java
>    Affects Versions: 1.3
>            Reporter: Frank Maritato
>            Priority: Minor
>             Fix For: 1.4
>
>
> I have a patch to add methods to SolrServer.java and UpdateRequest.java to accept a list
of Strings for deleteById. 
> Internally, UpdateRequest uses a list for the single api, but SolrServer calls process
immediately after the single so it would send all my deletes to the server one by one. This
change adds a method to UpdateRequest to add a List to the internal list, SolrServer calls
this method then process immediately after.
> Would be nice if you can get this in for 1.4.
> Thanks :)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message