C
C
Carlos Rodriguez2014-12-25 12:31:22
Sphinx
Carlos Rodriguez, 2014-12-25 12:31:22

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

2 answer(s)
C
Carlos Rodriguez, 2014-12-26
@asf

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

K
korzhik, 2014-12-25
@korzhik

what's in the sphinx config?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question