Приветствую, есть где посмотреть готовый рабочий конфиг для sphinx? Просто тот что в админке смартсиджи Sphinx config (example) у меня не работает. Я в нем подправил index main_site_index, но все равно не работает, выдает ошибки типо section contents: expected token, got '('
еще там куча слэшей с пустыми строками. есть у кого просто рабочий конфиг для sphinx?
Помогите с конфигом sphinx
Re: Помогите с конфигом sphinx
Приветствую!
полностью конфиг и полностью ошибку в студию
полностью конфиг и полностью ошибку в студию
Don't forget to run script update
Re: Помогите с конфигом sphinx
ERROR: section contents: expected token, got '(' in /etc/sphinxsearch/sphinx.conf line 27 col 2.
FATAL: failed to parse config file '/etc/sphinxsearch/sphinx.conf'
FATAL: failed to parse config file '/etc/sphinxsearch/sphinx.conf'
Code: Select all
#This is an example, you can modify this code
source main_site_source
{
type = mysql
sql_host = localhost
sql_user = юзер
sql_pass = пароль
sql_db = имя-базы
sql_query_pre = SET NAMES utf8
sql_query_pre = UPDATE rot_settings SET value = (SELECT MAX(gallery_id) FROM rot_gallery_info WHERE gallery_status = 'active') WHERE name = 'sphinx_max_gallery_id'
sql_query = SELECT gi.gallery_id, UNIX_TIMESTAMP(gi.activation_date) as date, \
\
gd.alt, gd.description, gi.duration, gi.sponsor_id, gs.total_ctr, gi.content_type, rot_sponsors.sponsor_name, rot_sponsors.sponsor_site,\
\
\
(SELECT group_concat(tag_id) FROM rot_gal2tag g2t \
WHERE g2t.gallery_id = gi.gallery_id) as tag_ids, \
\
# TAGS START you can remove this part up to TAG END \
# this part indexes tags, if you remove it - tags wont be indexed \
# ligther index = less memory usage and faster search \
(SELECT group_concat(tag_name) FROM rot_gal2tag g2t \
LEFT JOIN rot_tags as t on t.tag_id = g2t.tag_id \
WHERE g2t.gallery_id = gi.gallery_id) as tags, \
\
# TAGS END \
\
\
# GROUP START you can remove this part up to TAG END \
# this part indexes group names, if you remove it - it wont be indexed \
# ligther index = less memory usage and faster search \
(SELECT group_concat(name) FROM rot_groups \
WHERE rot_groups.id in (SELECT group_id FROM rot_gallery_stats1 \
WHERE rot_gallery_stats1.gallery_id = gi.gallery_id AND group_id != 0) \
) as group_names, \
\
\
# GROUP END \
\
# Models START you can remove this part up to MODEL END \
# this part indexes model names, if you remove it - it wont be indexed \
# ligther index = less memory usage and faster search \
(SELECT group_concat(concat(model_name, ',', model_alias)) FROM rot_models \
WHERE rot_models.model_id in (SELECT model_id FROM rot_gal2model \
WHERE rot_gal2model.gallery_id = gi.gallery_id) \
) as model_names, \
\
# MODEL END \
\
\
(SELECT group_concat(distinct(gss.group_id)) FROM rot_gallery_stats1 as gss \
WHERE gss.gallery_id = gi.gallery_id AND group_id != 0) as categories \
\
FROM rot_gallery_info AS gi \
JOIN rot_sponsors on rot_sponsors.sponsor_id = gi.sponsor_id \
JOIN rot_gallery_data1 AS gd ON gi.gallery_id = gd.gallery_id \
\
\
JOIN rot_gallery_stats1 AS gs ON gs.gallery_id = gi.gallery_id \
WHERE gallery_status = 'active' and gallery_type = 0 \
and gs.best_thumb = 'yes' and gs.group_id = 0 \
AND gs.group_id NOT IN (SELECT group_id FROM rot_groups_data WHERE status != 1)
sql_attr_timestamp = date
#if you use sphinx 3+ - uncomment line below and remove line above
#sql_attr_uint = date
sql_attr_uint = duration
sql_attr_uint = sponsor_id
sql_attr_float = total_ctr
sql_attr_uint = content_type
sql_attr_multi = uint tag_ids from field;
sql_attr_multi = uint categories from field;
}
index main_site_index
{
source = main_site_source
path = /путь/baza/sphinx
docinfo = extern
morphology = stem_en
}
Re: Помогите с конфигом sphinx
все понял, я не подумал что комменты останутся, переделал пример конфига
вам надо просто удалить все строки которые начинаются на # и будет ок
вам надо просто удалить все строки которые начинаются на # и будет ок
Don't forget to run script update
Re: Помогите с конфигом sphinx
не знаю не получается у меня то такая expected token, got '(' то такая section contents: expected token, got '\' ошибка
скинте рабочий конфиг если не трудно
скинте рабочий конфиг если не трудно
Re: Помогите с конфигом sphinx
опять же полный конфиг и полностьбю ошибку
Don't forget to run script update
Re: Помогите с конфигом sphinx
using config file '/etc/sphinxsearch/sphinx.conf'...
ERROR: section contents: expected token, got '(' in /etc/sphinxsearch/sphinx.conf line 23 col 2.
FATAL: failed to parse config file '/etc/sphinxsearch/sphinx.conf'
ERROR: section contents: expected token, got '(' in /etc/sphinxsearch/sphinx.conf line 23 col 2.
FATAL: failed to parse config file '/etc/sphinxsearch/sphinx.conf'
Code: Select all
source src1
{
type = mysql
sql_host = localhost
sql_user = src1
sql_pass = pass
sql_db = src1db
sql_query_pre = SET NAMES utf8
sql_query_pre = UPDATE rot_settings SET value = (SELECT MAX(gallery_id) FROM rot_gallery_info WHERE gallery_status = 'active') WHERE name = 'sphinx_max_gallery_id'
sql_query = SELECT gi.gallery_id, UNIX_TIMESTAMP(gi.activation_date) as date, \
\
gd.alt, gd.description, gi.duration, gi.sponsor_id, gs.total_ctr, gi.content_type, rot_sponsors.sponsor_name, rot_sponsors.sponsor_site,\
\
\
(SELECT group_concat(tag_id) FROM rot_gal2tag g2t \
WHERE g2t.gallery_id = gi.gallery_id) as tag_ids, \
\
(SELECT group_concat(tag_name) FROM rot_gal2tag g2t \
LEFT JOIN rot_tags as t on t.tag_id = g2t.tag_id \
WHERE g2t.gallery_id = gi.gallery_id) as tags, \
\
\
\
(SELECT group_concat(name) FROM rot_groups \
WHERE rot_groups.id in (SELECT group_id FROM rot_gallery_stats1 \
WHERE rot_gallery_stats1.gallery_id = gi.gallery_id AND group_id != 0) \
) as group_names, \
\
\
\
(SELECT group_concat(concat(model_name, ',', model_alias)) FROM rot_models \
WHERE rot_models.model_id in (SELECT model_id FROM rot_gal2model \
WHERE rot_gal2model.gallery_id = gi.gallery_id) \
) as model_names, \
\
\
\
(SELECT group_concat(distinct(gss.group_id)) FROM rot_gallery_stats1 as gss \
WHERE gss.gallery_id = gi.gallery_id AND group_id != 0) as categories \
\
FROM rot_gallery_info AS gi \
JOIN rot_sponsors on rot_sponsors.sponsor_id = gi.sponsor_id \
JOIN rot_gallery_data1 AS gd ON gi.gallery_id = gd.gallery_id \
\
\
JOIN rot_gallery_stats1 AS gs ON gs.gallery_id = gi.gallery_id \
WHERE gallery_status = 'active' and gallery_type = 0 \
and gs.best_thumb = 'yes' and gs.group_id = 0 \
AND gs.group_id NOT IN (SELECT group_id FROM rot_groups_data WHERE status != 1)
sql_attr_timestamp = date
#if you use sphinx 3+ - uncomment line below and remove line above
#sql_attr_uint = date
sql_attr_uint = duration
sql_attr_uint = sponsor_id
sql_attr_float = total_ctr
sql_attr_uint = content_type
sql_attr_multi = uint tag_ids from field;
sql_attr_multi = uint categories from field;
}
index src1_index
{
source = src1
path = /home/user1/domains/src1.xyz/public_html/src1_spx
docinfo = extern
morphology = stem_en
}
Re: Помогите с конфигом sphinx
earch/sphinx.conf line 23
на 23 строка ничего нет
надо или \
или вообще удалить пустые строки
на 23 строка ничего нет
надо или \
или вообще удалить пустые строки
Don't forget to run script update