Answer the question
In order to leave comments, you need to log in
Yii2 + Sphinx: How to solve Undefined index: Index error?
I use https://github.com/yiisoft/yii2-sphinx
specified in the configuration file
'sphinx' => [
'class' => 'yii\sphinx\Connection',
'dsn' => 'mysql:host=localhost;port =9306;dbname=test',
'username' => 'root',
'password' => 'root',
],
in the controller:
static public function search()
{
return Test::find()
->from(self ::tableName())
->andWhere(['price' => 500])
->all();
}
As a result I get Undefined index: Index
Answer the question
In order to leave comments, you need to log in
1) check if sphinx is running ps aux | grep searchd
2) run sudo service sphinxsearch restart
2) it is important to specify 127.0.0.1 in the config and not localhost
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question