0

I ran into a problem whereby our Sphinx SQL queries are getting truncated. This was due to the default limit for the Group Concat function in MySQL being 1024 bytes.

I used the following in my Sphinx.conf to fix this issue:

sql_query_pre = SET SESSION group_concat_max_len = 10000

This fixed the issue on my local machine. However, I have updated the sphinx.conf on our staging server and ran the command:

indexer --config sphinx.staging.conf --all --rotate

to update the indexes but the group concat part of the query is still being truncated at 1024 bytes.

Sphinx version: 2.2.10 Server version: CentOS Linux release 7.2.1511 Mysql: libmysql - 5.5.47-MariaDB (local version: libmysql - mysqlnd 5.0.10)

I'm not particularly experienced with Sphinx so may have missed some obvious step. Also, we do not want to change the default limits in our MySql config as these provide some protection in other situations.

1 Answers1

0

The problem was that if you have a common config section which contains:

source sCommon sql_query_pre = SET SESSION group_concat_max_len = 10000

but susequently, in a child config section which inherets the common config, define another sql_query_pre setting:

source sUsers : sCommon sql_query_pre = SET NAMES utf8

these will overwrite any settings that were applied in the common config and hence the common config will not get applied.