private void sendDeletes(List deletes) throws SolrServerException, IOException {
if (deletes.size() > 0) {
UpdateRequest req = new UpdateRequest();
for (Object delete : deletes) {
if (delete instanceof String) {
req.deleteById((String)delete); // add the delete to the req list
} else {
req.deleteByQuery(((StringBuilder)delete).toString()); // add the delete to the req list
}
}
req.setCommitWithin(-1);