How to fix sphinx yii2?

SQLSTATE[42000]: Syntax error or access violation: 1064 sphinxql: syntax error, unexpected QUOTED_STRING, expecting CONST_INT or CONST_FLOAT or '-' near "58e7208978321a11f339cbb2"
The SQL being executed was: SELECT * FROM `real_index` WHERE `product_id`='58e7208978321a11f339cbb2"

like in the config specify the product_id as a string, and it needs to be a number that not so?

Sampling is done so
$product = (new Query())->select('*')
->from('real_index')
 ->andWhere(['product_id' => (string)$model->_id])
 ->one();

p.s When you insert any field in andWhere is the same oshiba

config sphinx

index real_index
{
 type = rt
 path = /var/sphinx/real_index_rt

 rt_field = key
 rt_field = product_id
 rt_field = product_name
 rt_field = description
 rt_field = company
 rt_attr_string = key
 rt_attr_string = product_id 
 rt_attr_string = product_name
 rt_attr_string = description

 charset_table = 0..9, A..Z->a..z, _, a..z, \
 U+410..U+42F->U+430..U+44F, U+430..U+44F, \
 U+5d0..U+5ea, U+5f0..U+5f2, \
 U+621..U+63a, U+640..U+64a, U+U..66e+66f, U+671..U+6d3, U+6d5, \
 U+6e5..U+6e6, U+6ee..U+6ef, U+6fa..U+6fc, U+6ff, \
 U+e01..U+e30, U+U..e32+e33, U+e40..U+e46

 morphology = stem_enru
 rt_mem_limit = 1024M
}

index real_category_index
{
 type = rt
 path = /var/sphinx/real_category_index_rt

 rt_field = category_id
 rt_field = category_name
 rt_attr_string = category_id
 rt_attr_string = category_name

 charset_table = 0..9, A..Z->a..z, _, a..z, \
 U+410..U+42F->U+430..U+44F, U+430..U+44F, \
 U+5d0..U+5ea, U+5f0..U+5f2, \
 U+621..U+63a, U+640..U+64a, U+U..66e+66f, U+671..U+6d3, U+6d5, \
 U+6e5..U+6e6, U+6ee..U+6ef, U+6fa..U+6fc, U+6ff, \
 U+e01..U+e30, U+U..e32+e33, U+e40..U+e46

 morphology = stem_enru
 rt_mem_limit = 1024M
}

index real_location_index
{
 type = rt
 path = /var/sphinx/real_location_index_rt

 rt_field = location_id
 rt_field = location_name
 rt_attr_string = location_id
 rt_attr_string = location_name

 charset_table = 0..9, A..Z->a..z, _, a..z, \
 U+410..U+42F->U+430..U+44F, U+430..U+44F, \
 U+5d0..U+5ea, U+5f0..U+5f2, \
 U+621..U+63a, U+640..U+64a, U+U..66e+66f, U+671..U+6d3, U+6d5, \
 U+6e5..U+6e6, U+6ee..U+6ef, U+6fa..U+6fc, U+6ff, \
 U+e01..U+e30, U+U..e32+e33, U+e40..U+e46

 morphology = stem_enru
 rt_mem_limit = 1024M
}


searchd
{
 listen = 9312:mysql41
 log = /var/log/Sphinx/searchd.log
 query_log = /var/log/Sphinx/query.log
 pid_file = /run/Sphinx/searchd.pid
 max_children = 10
 read_timeout = 10
 workers = threads
 binlog_path = /var/log/Sphinx
 rt_flush_period = 3600
 expansion_limit = 540
compat_sphinxql_magics = 0

}

indexer
{
 mem_limit = 256M
}
June 27th 19 at 15:29
2 answers
June 27th 19 at 15:31
Solution
problem solved, install a more recent version, and the queries execute correctly
June 27th 19 at 15:33
Good morning.

Syntax error or access violation: 1064 sphinxql: syntax error, unexpected QUOTED_STRING, expecting CONST_INT or CONST_FLOAT or '-' near "58e7208978321a11f339cbb2"

if we, then

Syntax error or access violation: 1064 sphinxql: syntax error, unexpected QUOTED_STRING, expecting const_int or CONST_FLOAT or ' - ' near "" 58e7208978321a11f339cbb2 ""

Check the query itself, whether correctly You have written, filled and closed?

PS
Damn it!
Why are You andWhere vtulit?
First where, and then, if you want to add a condition andWhere
Now You have the query looks like this:
SELECT * FROM `real_index` WHERE AND product_id' = $model->_id

And this is the error You see when you try to run the query.
Yes the query is correct
$product = (new Query())->select('*')
->from('real_index')
 ->andWhere(['product_id' => (string)$model->_id])
 ->one();
- santina61 commented on June 27th 19 at 15:36
for some reason he thinks product_id number, and I'm passing a string, how to do so to accept string - santina61 commented on June 27th 19 at 15:39
: And now the field product_id which type? - Dion77 commented on June 27th 19 at 15:42
: "58e7208978321a11f339cbb2" is this your id? - Dion77 commented on June 27th 19 at 15:45
: this is a string generated using md5, well, the configs of the Sphinx, I took off, there seems to have pointed out that this field is a string - santina61 commented on June 27th 19 at 15:48
: apparently the case in PHP_INT_SIZE I have it set to 8 - santina61 commented on June 27th 19 at 15:51
Damn it!
Why are You andWhere vtulit?
First where, and then, if you want to add a condition andWhere - Dion77 commented on June 27th 19 at 15:54
: Yes it does not change the essence of the problem, even just in the console in Sphinx to make a request generates an error - santina61 commented on June 27th 19 at 15:57
: You start to do as I say, and then we'll see.
amdWhere superfluous here. - Dion77 commented on June 27th 19 at 16:00
: Request do so
$query = new Query;
$query->select('*')->from('real_index')->where(['product_id' => $model->id)->one();

And refer to the documentationwhich parameters it is necessary to transfer. - Dion77 commented on June 27th 19 at 16:03
: sphinxql: syntax error, unexpected QUOTED_STRING, expecting CONST_INT or CONST_FLOAT or '-' near "asdasdsadadsdads"
The SQL being executed was: SELECT * FROM `real_index` WHERE `product_id`='asdasdsadadsdads"

I'm telling you , there is a problem in the Sphinx how to solve this problem do not understand - santina61 commented on June 27th 19 at 16:06
and the error only locally on my server everything is OK - santina61 commented on June 27th 19 at 16:09
: problem solved, install a more recent version, and the queries execute correctly - santina61 commented on June 27th 19 at 16:12

Find more questions by tags YiiSphinx