views:

22

answers:

1

Hi,

I am having some trouble deleting documents from Solr index. I use following code:

    try{
        $solr->deleteById('1');
        $solr->commit();
        $solr->optimize();
    }catch (Exception $e){
        echo $e->getMessage();
    }

This code sometimes succeeds, but most of the time the following exception message is returned: "0" Status: Communication Error

A: 

I have quickly dropped my own Solr client class using code written by Brian Lucas. It is a bit raw but straightforward and seems to solve the problem. Source code

spacemonkey