mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-02 06:51:08 +02:00
[feature/sphinx-fulltext-search] use new unique id instead of salt
a new unique id is generated by sphinx and stored in the config table instead of using avatar_salt. PHPBB3-10946
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
source source_phpbb_{AVATAR_SALT}_main
|
source source_phpbb_{SPHINX_ID}_main
|
||||||
{
|
{
|
||||||
type = mysql
|
type = mysql
|
||||||
sql_host = localhost
|
sql_host = localhost
|
||||||
@@ -38,7 +38,7 @@ source source_phpbb_{AVATAR_SALT}_main
|
|||||||
\
|
\
|
||||||
p.topic_id = t.topic_id
|
p.topic_id = t.topic_id
|
||||||
\
|
\
|
||||||
AND p.post_id >= $start AND p.post_id <= $end
|
AND p.post_id >= $start AND p.post_id <= $end
|
||||||
sql_query_post =
|
sql_query_post =
|
||||||
sql_query_post_index = REPLACE INTO phpbb_sphinx ( counter_id, max_doc_id ) VALUES ( 1, $maxid )
|
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_info = SELECT * FROM phpbb_posts WHERE post_id = $id
|
||||||
@@ -60,10 +60,10 @@ source source_phpbb_{AVATAR_SALT}_delta : source_phpbb_{AVATAR_SALT}_main
|
|||||||
sql_query = SELECT
|
sql_query = SELECT
|
||||||
\
|
\
|
||||||
p.post_id AS id,
|
p.post_id AS id,
|
||||||
\
|
\
|
||||||
p.forum_id,
|
p.forum_id,
|
||||||
\
|
\
|
||||||
p.topic_id,
|
p.topic_id,
|
||||||
\
|
\
|
||||||
p.poster_id,
|
p.poster_id,
|
||||||
\
|
\
|
||||||
@@ -73,10 +73,10 @@ index index_phpbb_{AVATAR_SALT}_main
|
|||||||
\
|
\
|
||||||
p.post_subject,
|
p.post_subject,
|
||||||
\
|
\
|
||||||
p.post_subject as title,
|
p.post_subject as title,
|
||||||
\
|
\
|
||||||
p.post_text as data,
|
p.post_text as data,
|
||||||
\
|
\
|
||||||
t.topic_last_post_time,
|
t.topic_last_post_time,
|
||||||
\
|
\
|
||||||
0 as deleted
|
0 as deleted
|
||||||
|
@@ -72,16 +72,17 @@ class phpbb_search_fulltext_sphinx
|
|||||||
// Initialize phpbb_db_tools object
|
// Initialize phpbb_db_tools object
|
||||||
$this->db_tools = new phpbb_db_tools($this->db);
|
$this->db_tools = new phpbb_db_tools($this->db);
|
||||||
|
|
||||||
$this->id = $config['avatar_salt'];
|
if(!$this->config['fulltext_sphinx_id'])
|
||||||
|
{
|
||||||
|
set_config('fulltext_sphinx_id', unique_id());
|
||||||
|
}
|
||||||
|
$this->id = $this->config['fulltext_sphinx_id'];
|
||||||
$this->indexes = 'index_phpbb_' . $this->id . '_delta;index_phpbb_' . $this->id . '_main';
|
$this->indexes = 'index_phpbb_' . $this->id . '_delta;index_phpbb_' . $this->id . '_main';
|
||||||
|
|
||||||
$this->sphinx = new SphinxClient();
|
$this->sphinx = new SphinxClient();
|
||||||
|
|
||||||
// We only support localhost for now
|
// We only support localhost for now
|
||||||
$this->sphinx->SetServer('localhost', (isset($config['fulltext_sphinx_port']) && $config['fulltext_sphinx_port']) ? (int) $config['fulltext_sphinx_port'] : 3312);
|
$this->sphinx->SetServer('localhost', (isset($this->config['fulltext_sphinx_port']) && $this->config['fulltext_sphinx_port']) ? (int) $this->config['fulltext_sphinx_port'] : 3312);
|
||||||
|
|
||||||
$config['fulltext_sphinx_min_word_len'] = 2;
|
|
||||||
$config['fulltext_sphinx_max_word_len'] = 400;
|
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
}
|
}
|
||||||
@@ -137,8 +138,8 @@ class phpbb_search_fulltext_sphinx
|
|||||||
include ($phpbb_root_path . 'config.' . $phpEx);
|
include ($phpbb_root_path . 'config.' . $phpEx);
|
||||||
|
|
||||||
/* Now that we're sure everything was entered correctly,
|
/* Now that we're sure everything was entered correctly,
|
||||||
generate a config for the index. We misuse the avatar_salt
|
generate a config for the index. We use a config value
|
||||||
for this, as it should be unique. */
|
fulltext_sphinx_id for this, as it should be unique. */
|
||||||
$config_object = new phpbb_search_sphinx_config($this->config_file_data);
|
$config_object = new phpbb_search_sphinx_config($this->config_file_data);
|
||||||
|
|
||||||
$config_data = array(
|
$config_data = array(
|
||||||
|
Reference in New Issue
Block a user