panjiwa10028 / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

Add deleteByMultipleIds also to balancer #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The public deleteByMultipleIds() function should be added also to the
Apache_Solr_Service_Balancer class. Attached is a patch against Balancer.php

Code:
/**
 * Create and post a delete document based on multiple document IDs.
 *
 * @param array $ids Expected to be utf-8 encoded strings
 * @param boolean $fromPending
 * @param boolean $fromCommitted
 * @param float $timeout Maximum expected duration of the delete operation
on the server (otherwise, will throw a communication exception)
 * @return Apache_Solr_Response
 *
 * @throws Exception If an error occurs during the service call
 */
public function deleteByMultipleIds($ids, $fromPending = true,
$fromCommitted = true, $timeout = 3600)
{
    $service = $this->_selectWriteService();

    do
    {
        try
        {
            return $service->deleteByMultipleIds($ids, $fromPending, $fromCommitted,
$timeout);
        }
        catch (Exception $e)
        {
            if ($e->getCode() != 0) //IF NOT COMMUNICATION ERROR
            {
                throw $e;
            }
        }

        $service = $this->_selectWriteService(true);
    } while ($service);

    return false;
}

Original issue reported on code.google.com by clau.cri...@gmail.com on 6 Feb 2010 at 10:13

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you Clau for pointing this out. I've synchronized a number of optional 
arguments to other methods as well 
that had not been propogated to this class.

All in revision 30

Original comment by donovan....@gmail.com on 20 Feb 2010 at 12:02