How to configure yii2-solr extension

我是研究僧i 提交于 2021-02-07 04:38:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!