Как исправить ошибку sphinx yii2? Правка Пожаловаться на это сообщение Цитата

L0
На сайте с 26.12.2016
Offline
30
1595

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''

Выборка делается так


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

p.s При вставке любого поля в andWhere будет аналогичная ошиба

конфиг 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+66e..U+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+e32..U+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+66e..U+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+e32..U+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+66e..U+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+e32..U+e33, U+e40..U+e46

morphology = stem_enru
rt_mem_limit = 1024M
}


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

}

indexer
{
mem_limit = 256M
}
S
На сайте с 30.09.2016
Offline
469
#1

Посмотрите в БД, какой там реальный тип данных.

Отпилю лишнее, прикручу нужное, выправлю кривое. Вытравлю вредителей.
L0
На сайте с 26.12.2016
Offline
30
#2
Sitealert:
Посмотрите в БД, какой там реальный тип данных.

так в бд нет ничего, все хранится в файлах

вот пример записи

array(1) {
[0]=>
array(6) {
["id"]=>
string(1) "1"
["key"]=>
string(0) ""
["product_id"]=>
string(16) "asdasdsadadsdads"
["product_name"]=>
string(12) "product_name"
["description"]=>
string(0) ""
["company"]=>
string(0) ""
}
}
L0
На сайте с 26.12.2016
Offline
30
#3

проблему решил, установил более свежую версию, и запросы выполняются корректно

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий