mirror of https://github.com/apache/lucene.git
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:
parent
fdbc44dfc4
commit
7e5cd7b147
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue