use yii\sphinx\Query;
$query = new Query;
$rows = $query->select('text')
->from('posts')
->all();
var_dump($rows); die();
Database Exception – yii\db\Exception
SQLSTATE[42000]: Syntax error or access violation: 1064 index posts: parse error: unknown identifier 'text' (not an attribute, not a function)
The SQL being executed was: SELECT `text` FROM `posts`
Error Info: Array
(
[0] => 42000
[1] => 1064
[2] => index posts: parse error: unknown identifier 'text' (not an attribute, not a function)
)
source selposts
{
type = mysql
sql_host = localhost
sql_user = uzerrr
sql_pass = pazzz
sql_db = database
sql_port = 3306 # optional, default is 3306
#sql_query = SELECT id, header, text FROM sel_posts WHERE header != 'NULL'
sql_query = SELECT * FROM sel_posts
}
index posts
{
source = selposts
path = /var/lib/sphinx/selectner/posts
charset_type = utf-8
}
source config_mysite
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass = mysql
sql_db = new_db
sql_port = 3306
sql_query_pre = SET NAMES utf8
sql_query_pre = SET CHARACTER SET utf8
}
source mysite_selposts :config_mysite
{
sql_query = \
SELECT `id`, `text` FROM sel_posts
sql_field_string = text
}