问题
I want to use yii2-solr extension in one of my projects. How can I configure this extension. Nothing is mentioned on the extension page. Has anyone used this extension? Any help would be appreciable. Thank you.
I found the extension on github repo . In readme file it is mention to configure it as follows:
'solr' => [
'class' => 'sammaye\solr\Client',
'options' => [
'endpoint' => [
'solr1' => [
'host' => '10.208.225.66',
'port' => '8983',
'path' => '/solr'
]
]
]
],
But after doing all this I am getting the following error:
Class 'Solarium\Client' not found
In one of its Client.php file the line is:
use Solarium\Client as SolrClient;
I checked all the files but Solarium namespace is not there.
回答1:
yii2-solr depends on the Solarium library. If you installed yii2-solr via composer, it should have automatically downloaded it as dependency. Check github composer.json. If not, you'll have to install it manually, see packagist.
来源:https://stackoverflow.com/questions/30272298/how-to-configure-yii2-solr-extension