SOLR-1222 add convenience methods for deleteById to take a list of strings

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@786465 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2009-06-19 11:54:44 +00:00
parent fdbc44dfc4
commit 7e5cd7b147
2 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import java.io.IOException;
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 @@ public abstract class SolrServer implements Serializable
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 );
}

View File

@ -113,6 +113,13 @@ public class UpdateRequest extends SolrRequest
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 )
{