问题
I've got Solr set up on my server, and a test collection loaded.
Without installing anything else, I can search the collection fine using the Solr URL and JSON decoding file_get_contents($url)
.
In order to add/update/delete documents, do I need to install a PHP Solr client? Or is there a native way that is standard to use? If the former, is this the one to install?: http://www.php.net/manual/en/book.solr.php - or can you recommend another and why?
回答1:
Check the below links :
Integrate SOLR - wiki
SOLR PHP - Official Client Library
Link to download SOLR php client library
回答2:
In my company we've been successfully using the native Solr client for PHP that you've mentioned for a while now. I also found Solarium helpful, however it has it's limitations, so it might be worth looking into using HTTP request tools like Guzzle, Httpful and such.
来源:https://stackoverflow.com/questions/19695675/how-to-add-docs-to-solr-using-php