I use PHP to access Solr, and I wonder at one thing.
Why should I use the Solr PHP client when I can use:
$serializedResult = file_get_contents( 'http://localhost:8983/solr/select?q=niklas&wt=phps');
to get the result in arrays and then print them? I really do not understand. Are there any richer features with the PHP client?
I think for the following reasons:
All problems are the headache of these ready-made scripts and frameworks. Therefore, if there is a solution for a specific purpose, I would recommend that you go with this, and not do everything on your own.
, , , ..
solr-php-client file_get_contents (@see Apache_Solr_HttpTransport_FileGetContents), Curl. solr-php-client , , URL- w/parameters, . SPC , . , solr-php- Zend Framework, ZF.
, script, , , . , , script, , , .
, solr ( URL- ..).
file_get_contents()... php allow_url_open. - , - , .
In some cases, however, it makes sense to do file_get_contents (). SolrClient has nothing to collapse a field (this is a patch not available in trunk), so I must either write my own class that mimics SolrClient and SolrQuery if I cannot do this using the PECL library.