1. Go to this page and download the library: Download cpliakas/psolr library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cpliakas / psolr example snippets
use PSolr\Client\SolrClient;
use PSolr\Request as Request;
// Connect to a Solr server.
$solr = SolrClient::factory(array(
'base_url' => 'http://myserver.com:8080', // defaults to "http://localhost:8983"
'base_path' => '/solr/myIndex', // defaults to "/solr"
));