1--TEST-- 2SolrClient::deleteByIds() - Test deleting documents by an array of IDS 3--SKIPIF-- 4<?php 5include 'skip.if.server_not_configured.inc'; 6?> 7--FILE-- 8<?php 9 10require_once "bootstrap.inc"; 11 12$options = array 13( 14 'hostname' => SOLR_SERVER_HOSTNAME, 15 'login' => SOLR_SERVER_USERNAME, 16 'password' => SOLR_SERVER_PASSWORD, 17 'port' => SOLR_SERVER_PORT, 18 'path' => SOLR_SERVER_PATH 19); 20 21$client = new SolrClient($options); 22$response = $client->deleteByIds(array('334455','334456')); 23$client->commit(); 24print_r($response->getResponse()); 25 26try { 27 $client->deleteByIds(array(0)); 28} catch (SolrIllegalArgumentException $e) { 29 echo sprintf("Exception %d: %s", $e->getCode(), $e->getMessage()). PHP_EOL; 30} 31 32try { 33 $client->deleteByIds(array('334455', '')); 34} catch (SolrIllegalArgumentException $e) { 35 echo sprintf("Exception %d: %s", $e->getCode(), $e->getMessage()). PHP_EOL; 36} 37 38?> 39--EXPECTF-- 40SolrObject Object 41( 42 [responseHeader] => SolrObject Object 43 ( 44 [status] => %d 45 [QTime] => %d 46 ) 47 48) 49Exception 4000: Id number 1 is not a valid string 50Exception 4000: Id number 2 is not a valid string