diff --git a/phpBB/docs/sphinx.sample.conf b/phpBB/docs/sphinx.sample.conf index 06595a766f..eaef081aa1 100644 --- a/phpBB/docs/sphinx.sample.conf +++ b/phpBB/docs/sphinx.sample.conf @@ -6,6 +6,8 @@ source source_phpbb_{SPHINX_ID}_main sql_pass = password sql_db = db_name sql_port = 3306 #optional, default is 3306 + sql_query_pre = SET NAMES 'utf8' + sql_query_pre = REPLACE INTO phpbb_sphinx SELECT 1, MAX(post_id) FROM phpbb_posts sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts sql_range_step = 5000 sql_query = SELECT \ @@ -27,8 +29,6 @@ source source_phpbb_{SPHINX_ID}_main sql_query_post = sql_query_post_index = REPLACE INTO phpbb_sphinx ( counter_id, max_doc_id ) VALUES ( 1, $maxid ) sql_query_info = SELECT * FROM phpbb_posts WHERE post_id = $id - sql_query_pre = SET NAMES utf8 - sql_query_pre = REPLACE INTO phpbb_sphinx SELECT 1, MAX(post_id) FROM phpbb_posts sql_attr_uint = forum_id sql_attr_uint = topic_id sql_attr_uint = poster_id diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php index 747c22a3ef..c223284c72 100644 --- a/phpBB/includes/search/fulltext_sphinx.php +++ b/phpBB/includes/search/fulltext_sphinx.php @@ -150,7 +150,7 @@ class phpbb_search_fulltext_sphinx array('sql_pass', $dbpasswd), array('sql_db', $dbname), array('sql_port', $dbport), - array('sql_query_pre', 'SET NAMES utf8'), + array('sql_query_pre', 'SET NAMES \'utf8\''), array('sql_query_pre', 'REPLACE INTO ' . SPHINX_TABLE . ' SELECT 1, MAX(post_id) FROM ' . POSTS_TABLE . ''), array('sql_query_range', 'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''), array('sql_range_step', '5000'),