Solr 4.0的PHP库/客户端

I wanted to upgrade my Solr engine from 3.5 to 4.0. But my old php library for solr, does not seem to handle Solr 4.0 commits well. Ex waitFlush problem.

Is there a library/client that supports new Solr 4.0 constructs well. Or should I use some Java client etc for handling the commits?

According to this bug thread, there is an unofficial fork of this PECL extension which can resolve the issue.

Another way of solving this issue. Just create your own commit function. Something like this:

    $solrConfig= // array with solr host, port, path to collection (/solr/my_collection), 
    $solrAddress = $solrConfig['hostname'] . ':' . $solrConfig['port'] . $solrConfig['path'];
    $output = array();
    $response = exec('curl ' . $solrAddress . '/update?commit=true', $output);

It doesn't have to be exec() - send php curl instead or You can try with send_raw_get from php solr_client but the last one is just guess. exec() worked fine for me!

Update: PECL Solr Supports Solr Server 4.0+, since version 2.0

https://pecl.php.net/package-changelog.php?package=solr