aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2012-07-22 02:50:53 +0530
committerDhruv <dhruv.goel92@gmail.com>2012-07-22 02:50:53 +0530
commit161e469b5a67b2911089ec0dfdb70bef355ed07e (patch)
treeca57f1199edc45212f770181275d29e54953af76
parent0e9eb9401a38fab3139a1df33fa7e0903ccfb18f (diff)
downloadforums-161e469b5a67b2911089ec0dfdb70bef355ed07e.tar
forums-161e469b5a67b2911089ec0dfdb70bef355ed07e.tar.gz
forums-161e469b5a67b2911089ec0dfdb70bef355ed07e.tar.bz2
forums-161e469b5a67b2911089ec0dfdb70bef355ed07e.tar.xz
forums-161e469b5a67b2911089ec0dfdb70bef355ed07e.zip
[feature/sphinx-fulltext-search] makes sql host configurable
The SQL server host which sphinx connects to index the posts is now configurable via ACP. PHPBB3-10946
-rw-r--r--phpBB/docs/sphinx.sample.conf4
-rw-r--r--phpBB/includes/search/fulltext_sphinx.php9
-rw-r--r--phpBB/language/en/acp/search.php2
3 files changed, 11 insertions, 4 deletions
diff --git a/phpBB/docs/sphinx.sample.conf b/phpBB/docs/sphinx.sample.conf
index 8ffd54a880..d0a897e0cc 100644
--- a/phpBB/docs/sphinx.sample.conf
+++ b/phpBB/docs/sphinx.sample.conf
@@ -1,7 +1,7 @@
source source_phpbb_{SPHINX_ID}_main
{
- type = mysql
- sql_host = localhost
+ type = mysql #mysql or pgsql
+ sql_host = localhost #SQL server host sphinx connects to
sql_user = username
sql_pass = password
sql_db = db_name
diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php
index 1888057db4..3bdce5dfb9 100644
--- a/phpBB/includes/search/fulltext_sphinx.php
+++ b/phpBB/includes/search/fulltext_sphinx.php
@@ -162,11 +162,11 @@ class phpbb_search_fulltext_sphinx
$config_data = array(
'source source_phpbb_' . $this->id . '_main' => array(
array('type', $this->dbtype),
- array('sql_host', $dbhost),
+ array('sql_host', $this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : $dbhost),
array('sql_user', $dbuser),
array('sql_pass', $dbpasswd),
array('sql_db', $dbname),
- array('sql_port', $dbport),
+ array('sql_port', $this->config['fulltext_sphinx_port']),
array('sql_query_pre', 'SET NAMES \'utf8\''),
array('sql_query_pre', 'UPDATE ' . SPHINX_TABLE . ' SET max_doc_id = (SELECT MAX(post_id) FROM ' . POSTS_TABLE . ') WHERE counter_id = 1'),
array('sql_query_range', 'SELECT MIN(post_id), MAX(post_id) FROM ' . POSTS_TABLE . ''),
@@ -759,6 +759,7 @@ class phpbb_search_fulltext_sphinx
$config_vars = array(
'fulltext_sphinx_config_path' => 'string',
'fulltext_sphinx_data_path' => 'string',
+ 'fulltext_sphinx_host' => 'string',
'fulltext_sphinx_port' => 'int',
'fulltext_sphinx_stopwords' => 'bool',
'fulltext_sphinx_indexer_mem_limit' => 'int',
@@ -779,6 +780,10 @@ class phpbb_search_fulltext_sphinx
<dd><label><input type="radio" id="fulltext_sphinx_stopwords" name="config[fulltext_sphinx_stopwords]" value="1"' . (($this->config['fulltext_sphinx_stopwords']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $this->user->lang['YES'] . '</label><label><input type="radio" name="config[fulltext_sphinx_stopwords]" value="0"' . ((!$this->config['fulltext_sphinx_stopwords']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $this->user->lang['NO'] . '</label></dd>
</dl>
<dl>
+ <dt><label for="fulltext_sphinx_host">' . $this->user->lang['FULLTEXT_SPHINX_HOST'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_HOST_EXPLAIN'] . '</span></dt>
+ <dd><input id="fulltext_sphinx_host" type="text" size="40" maxlength="255" name="config[fulltext_sphinx_host]" value="' . $this->config['fulltext_sphinx_host'] . '" /></dd>
+ </dl>
+ <dl>
<dt><label for="fulltext_sphinx_port">' . $this->user->lang['FULLTEXT_SPHINX_PORT'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_PORT_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_sphinx_port" type="text" size="4" maxlength="10" name="config[fulltext_sphinx_port]" value="' . $this->config['fulltext_sphinx_port'] . '" /></dd>
</dl>
diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php
index 37c403f43d..99fbbac07e 100644
--- a/phpBB/language/en/acp/search.php
+++ b/phpBB/language/en/acp/search.php
@@ -75,6 +75,8 @@ $lang = array_merge($lang, array(
'FULLTEXT_SPHINX_DATA_PATH' => 'Path to data directory',
'FULLTEXT_SPHINX_DATA_PATH_EXPLAIN' => 'It will be used to store the indexes and log files. You should create this directory outside the web accessable directories.',
'FULLTEXT_SPHINX_DELTA_POSTS' => 'Number of posts in frequently updated delta index',
+ 'FULLTEXT_SPHINX_HOST' => 'SQL server host',
+ 'FULLTEXT_SPHINX_HOST_EXPLAIN' => 'SQL server host, which the sphinx search daemon (searchd) connects to. Leave empty to use the default SQL server host',
'FULLTEXT_SPHINX_INDEXER_MEM_LIMIT' => 'Indexer memory limit',
'FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN' => 'This number should at all times be lower than the RAM available on your machine. If you experience periodic performance problems this might be due to the indexer consuming too many resources. It might help to lower the amount of memory available to the indexer.',
'FULLTEXT_SPHINX_MAIN_POSTS' => 'Number of posts in main index',