aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/search
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/search')
-rw-r--r--phpBB/includes/search/fulltext_mysql.php91
-rw-r--r--phpBB/includes/search/fulltext_native.php121
-rw-r--r--phpBB/includes/search/fulltext_postgres.php118
-rw-r--r--phpBB/includes/search/fulltext_sphinx.php125
4 files changed, 411 insertions, 44 deletions
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index 81fb82de93..9f7e8a2195 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -22,18 +22,59 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_search_fulltext_mysql extends phpbb_search_base
{
+ /**
+ * Associative array holding index stats
+ * @var array
+ */
protected $stats = array();
+
+ /**
+ * Holds the words entered by user, obtained by splitting the entered query on whitespace
+ * @var array
+ */
protected $split_words = array();
+
+ /**
+ * Config object
+ * @var phpbb_config
+ */
protected $config;
+
+ /**
+ * DBAL object
+ * @var dbal
+ */
protected $db;
+
+ /**
+ * User object
+ * @var phpbb_user
+ */
protected $user;
- public $word_length = array();
- public $search_query;
- public $common_words = array();
+
+ /**
+ * Associative array stores the min and max word length to be searched
+ * @var array
+ */
+ protected $word_length = array();
+
+ /**
+ * Contains tidied search query.
+ * Operators are prefixed in search query and common words excluded
+ * @var string
+ */
+ protected $search_query;
+
+ /**
+ * Contains common words.
+ * Common words are words with length less/more than min/max length
+ * @var array
+ */
+ protected $common_words = array();
/**
* Constructor
- * Creates a new phpbb_search_fulltext_mysql, which is used as a search backend.
+ * Creates a new phpbb_search_fulltext_mysql, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
*/
@@ -59,6 +100,36 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
}
/**
+ * Returns the search_query
+ *
+ * @return string search query
+ */
+ public function get_search_query()
+ {
+ return $this->search_query;
+ }
+
+ /**
+ * Returns the common_words array
+ *
+ * @return array common words that are ignored by search backend
+ */
+ public function get_common_words()
+ {
+ return $this->common_words;
+ }
+
+ /**
+ * Returns the word_length array
+ *
+ * @return array min and max word length for searching
+ */
+ public function get_word_length()
+ {
+ return $this->word_length;
+ }
+
+ /**
* Checks for correct MySQL version and stores min/max word length in the config
*
* @return string|bool Language key of the error/incompatiblity occured
@@ -255,7 +326,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
}
/**
- * Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
*
* @param string $type contains either posts or topics depending on what should be searched for
* @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
@@ -276,7 +347,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
*/
public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
{
- // No keywords? No posts.
+ // No keywords? No posts
if (!$this->search_query)
{
return false;
@@ -443,7 +514,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
*/
public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
{
- // No author? No posts.
+ // No author? No posts
if (!sizeof($author_ary))
{
return 0;
@@ -581,7 +652,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
}
/**
- * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated.
+ * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
*
* @param string $mode contains the post mode: edit, post, reply, quote ...
* @param int $post_id contains the post id of the post to index
@@ -810,11 +881,11 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
$tpl = '
<dl>
- <dt><label>' . $this->user->lang['MIN_SEARCH_CHARS'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dt><label>' . $this->user->lang['MIN_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_MYSQL_MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
<dd>' . $this->config['fulltext_mysql_min_word_len'] . '</dd>
</dl>
<dl>
- <dt><label>' . $this->user->lang['MAX_SEARCH_CHARS'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dt><label>' . $this->user->lang['MAX_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
<dd>' . $this->config['fulltext_mysql_max_word_len'] . '</dd>
</dl>
';
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index 0e520b63a2..d0e660451c 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -22,25 +22,84 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_search_fulltext_native extends phpbb_search_base
{
+ /**
+ * Associative array holding index stats
+ * @var array
+ */
protected $stats = array();
- public $word_length = array();
- public $search_query;
- public $common_words = array();
+ /**
+ * Associative array stores the min and max word length to be searched
+ * @var array
+ */
+ protected $word_length = array();
+
+ /**
+ * Contains tidied search query.
+ * Operators are prefixed in search query and common words excluded
+ * @var string
+ */
+ protected $search_query;
+
+ /**
+ * Contains common words.
+ * Common words are words with length less/more than min/max length
+ * @var array
+ */
+ protected $common_words = array();
+
+ /**
+ * Post ids of posts containing words that are to be included
+ * @var array
+ */
protected $must_contain_ids = array();
+
+ /**
+ * Post ids of posts containing words that should not be included
+ * @var array
+ */
protected $must_not_contain_ids = array();
+
+ /**
+ * Post ids of posts containing atleast one word that needs to be excluded
+ * @var array
+ */
protected $must_exclude_one_ids = array();
+ /**
+ * Relative path to board root
+ * @var string
+ */
protected $phpbb_root_path;
+
+ /**
+ * PHP Extension
+ * @var string
+ */
protected $php_ext;
+
+ /**
+ * Config object
+ * @var phpbb_config
+ */
protected $config;
+
+ /**
+ * DBAL object
+ * @var dbal
+ */
protected $db;
+
+ /**
+ * User object
+ * @var phpbb_user
+ */
protected $user;
/**
- * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded.
+ * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded
*
- * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure.
+ * @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure
*/
public function __construct(&$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user)
{
@@ -59,6 +118,10 @@ class phpbb_search_fulltext_native extends phpbb_search_base
{
include($this->phpbb_root_path . 'includes/utf/utf_normalizer.' . $this->php_ext);
}
+ if (!function_exists('utf8_decode_ncr'))
+ {
+ include($this->phpbb_root_path . 'includes/utf/utf_tools.' . $this->php_ext);
+ }
$error = false;
}
@@ -74,14 +137,44 @@ class phpbb_search_fulltext_native extends phpbb_search_base
}
/**
- * This function fills $this->search_query with the cleaned user search query.
+ * Returns the search_query
+ *
+ * @return string search query
+ */
+ public function get_search_query()
+ {
+ return $this->search_query;
+ }
+
+ /**
+ * Returns the common_words array
+ *
+ * @return array common words that are ignored by search backend
+ */
+ public function get_common_words()
+ {
+ return $this->common_words;
+ }
+
+ /**
+ * Returns the word_length array
+ *
+ * @return array min and max word length for searching
+ */
+ public function get_word_length()
+ {
+ return $this->word_length;
+ }
+
+ /**
+ * This function fills $this->search_query with the cleaned user search query
*
* If $terms is 'any' then the words will be extracted from the search query
* and combined with | inside brackets. They will afterwards be treated like
* an standard search query.
*
* Then it analyses the query and fills the internal arrays $must_not_contain_ids,
- * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search().
+ * $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search()
*
* @param string $keywords contains the search query string as entered by the user
* @param string $terms is either 'all' (use search query as entered, default words to 'must be contained in post')
@@ -404,7 +497,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
}
/**
- * Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
*
* @param string $type contains either posts or topics depending on what should be searched for
* @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
@@ -763,7 +856,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
// if we use mysql and the total result count is not cached yet, retrieve it from the db
if (!$total_results && $is_mysql)
{
- // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
+ // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it
$sql_array_copy = $sql_array;
$sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id ';
@@ -812,7 +905,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
*/
public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
{
- // No author? No posts.
+ // No author? No posts
if (!sizeof($author_ary))
{
return 0;
@@ -1679,19 +1772,19 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$tpl = '
<dl>
- <dt><label for="fulltext_native_load_upd">' . $this->user->lang['YES_SEARCH_UPDATE'] . ':</label><br /><span>' . $this->user->lang['YES_SEARCH_UPDATE_EXPLAIN'] . '</span></dt>
+ <dt><label for="fulltext_native_load_upd">' . $this->user->lang['YES_SEARCH_UPDATE'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['YES_SEARCH_UPDATE_EXPLAIN'] . '</span></dt>
<dd><label><input type="radio" id="fulltext_native_load_upd" name="config[fulltext_native_load_upd]" value="1"' . (($this->config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $this->user->lang['YES'] . '</label><label><input type="radio" name="config[fulltext_native_load_upd]" value="0"' . ((!$this->config['fulltext_native_load_upd']) ? ' checked="checked"' : '') . ' class="radio" /> ' . $this->user->lang['NO'] . '</label></dd>
</dl>
<dl>
- <dt><label for="fulltext_native_min_chars">' . $this->user->lang['MIN_SEARCH_CHARS'] . ':</label><br /><span>' . $this->user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dt><label for="fulltext_native_min_chars">' . $this->user->lang['MIN_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_native_min_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_min_chars]" value="' . (int) $this->config['fulltext_native_min_chars'] . '" /></dd>
</dl>
<dl>
- <dt><label for="fulltext_native_max_chars">' . $this->user->lang['MAX_SEARCH_CHARS'] . ':</label><br /><span>' . $this->user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
+ <dt><label for="fulltext_native_max_chars">' . $this->user->lang['MAX_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_native_max_chars" type="text" size="3" maxlength="3" name="config[fulltext_native_max_chars]" value="' . (int) $this->config['fulltext_native_max_chars'] . '" /></dd>
</dl>
<dl>
- <dt><label for="fulltext_native_common_thres">' . $this->user->lang['COMMON_WORD_THRESHOLD'] . ':</label><br /><span>' . $this->user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt>
+ <dt><label for="fulltext_native_common_thres">' . $this->user->lang['COMMON_WORD_THRESHOLD'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_native_common_thres" type="text" size="3" maxlength="3" name="config[fulltext_native_common_thres]" value="' . (double) $this->config['fulltext_native_common_thres'] . '" /> %</dd>
</dl>
';
diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php
index dfe90db0f0..dd1b2359e0 100644
--- a/phpBB/includes/search/fulltext_postgres.php
+++ b/phpBB/includes/search/fulltext_postgres.php
@@ -22,22 +22,84 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_search_fulltext_postgres extends phpbb_search_base
{
+ /**
+ * Associative array holding index stats
+ * @var array
+ */
protected $stats = array();
+
+ /**
+ * Holds the words entered by user, obtained by splitting the entered query on whitespace
+ * @var array
+ */
protected $split_words = array();
+
+ /**
+ * True if PostgreSQL version supports tsearch
+ * @var boolean
+ */
protected $tsearch_usable = false;
+
+ /**
+ * Stores the PostgreSQL version
+ * @var string
+ */
protected $version;
+
+ /**
+ * Stores the tsearch query
+ * @var string
+ */
protected $tsearch_query;
+
+ /**
+ * True if phrase search is supported.
+ * PostgreSQL fulltext currently doesn't support it
+ * @var boolean
+ */
protected $phrase_search = false;
+
+ /**
+ * Config object
+ * @var phpbb_config
+ */
protected $config;
+
+ /**
+ * DBAL object
+ * @var dbal
+ */
protected $db;
+
+ /**
+ * User object
+ * @var phpbb_user
+ */
protected $user;
- public $search_query;
- public $common_words = array();
- public $word_length = array();
+
+ /**
+ * Contains tidied search query.
+ * Operators are prefixed in search query and common words excluded
+ * @var string
+ */
+ protected $search_query;
+
+ /**
+ * Contains common words.
+ * Common words are words with length less/more than min/max length
+ * @var array
+ */
+ protected $common_words = array();
+
+ /**
+ * Associative array stores the min and max word length to be searched
+ * @var array
+ */
+ protected $word_length = array();
/**
* Constructor
- * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend.
+ * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
*/
@@ -73,6 +135,36 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
}
/**
+ * Returns the search_query
+ *
+ * @return string search query
+ */
+ public function get_search_query()
+ {
+ return $this->search_query;
+ }
+
+ /**
+ * Returns the common_words array
+ *
+ * @return array common words that are ignored by search backend
+ */
+ public function get_common_words()
+ {
+ return $this->common_words;
+ }
+
+ /**
+ * Returns the word_length array
+ *
+ * @return array min and max word length for searching
+ */
+ public function get_word_length()
+ {
+ return $this->word_length;
+ }
+
+ /**
* Returns if phrase search is supported or not
*
* @return bool
@@ -224,7 +316,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
}
/**
- * Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
*
* @param string $type contains either posts or topics depending on what should be searched for
* @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
@@ -245,12 +337,18 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
*/
public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
{
- // No keywords? No posts.
+ // No keywords? No posts
if (!$this->search_query)
{
return false;
}
+ // When search query contains queries like -foo
+ if (strpos($this->search_query, '+') === false)
+ {
+ return false;
+ }
+
// generate a search_key from all the options to identify the results
$search_key = md5(implode('#', array(
implode(', ', $this->split_words),
@@ -416,7 +514,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
*/
public function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
{
- // No author? No posts.
+ // No author? No posts
if (!sizeof($author_ary))
{
return 0;
@@ -548,7 +646,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
}
/**
- * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated.
+ * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
*
* @param string $mode contains the post mode: edit, post, reply, quote ...
* @param int $post_id contains the post id of the post to index
@@ -762,11 +860,11 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
$tpl .= '</select></dd>
</dl>
<dl>
- <dt><label for="fulltext_postgres_min_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN'] . '</span></dt>
+ <dt><label for="fulltext_postgres_min_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_postgres_min_word_len" type="text" size="3" maxlength="3" name="config[fulltext_postgres_min_word_len]" value="' . (int) $this->config['fulltext_postgres_min_word_len'] . '" /></dd>
</dl>
<dl>
- <dt><label for="fulltext_postgres_max_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN'] . '</span></dt>
+ <dt><label for="fulltext_postgres_max_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_postgres_max_word_len" type="text" size="3" maxlength="3" name="config[fulltext_postgres_max_word_len]" value="' . (int) $this->config['fulltext_postgres_max_word_len'] . '" /></dd>
</dl>
';
diff --git a/phpBB/includes/search/fulltext_sphinx.php b/phpBB/includes/search/fulltext_sphinx.php
index ad9854071d..5f5ff15b07 100644
--- a/phpBB/includes/search/fulltext_sphinx.php
+++ b/phpBB/includes/search/fulltext_sphinx.php
@@ -28,26 +28,101 @@ define('SPHINX_CONNECT_WAIT_TIME', 300);
*/
class phpbb_search_fulltext_sphinx
{
+ /**
+ * Associative array holding index stats
+ * @var array
+ */
protected $stats = array();
+
+ /**
+ * Holds the words entered by user, obtained by splitting the entered query on whitespace
+ * @var array
+ */
protected $split_words = array();
+
+ /**
+ * Holds unique sphinx id
+ * @var string
+ */
protected $id;
+
+ /**
+ * Stores the names of both main and delta sphinx indexes
+ * separated by a semicolon
+ * @var string
+ */
protected $indexes;
+
+ /**
+ * Sphinx searchd client object
+ * @var SphinxClient
+ */
protected $sphinx;
+
+ /**
+ * Relative path to board root
+ * @var string
+ */
protected $phpbb_root_path;
+
+ /**
+ * PHP Extension
+ * @var string
+ */
protected $php_ext;
+
+ /**
+ * Auth object
+ * @var phpbb_auth
+ */
protected $auth;
+
+ /**
+ * Config object
+ * @var phpbb_config
+ */
protected $config;
+
+ /**
+ * DBAL object
+ * @var dbal
+ */
protected $db;
+
+ /**
+ * Database Tools object
+ * @var phpbb_db_tools
+ */
protected $db_tools;
+
+ /**
+ * Stores the database type if supported by sphinx
+ * @var string
+ */
protected $dbtype;
+
+ /**
+ * User object
+ * @var phpbb_user
+ */
protected $user;
+
+ /**
+ * Stores the generated content of the sphinx config file
+ * @var string
+ */
protected $config_file_data = '';
- public $search_query;
- public $common_words = array();
+
+ /**
+ * Contains tidied search query.
+ * Operators are prefixed in search query and common words excluded
+ * @var string
+ */
+ protected $search_query;
/**
* Constructor
- * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend.
+ * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
*/
@@ -87,7 +162,7 @@ class phpbb_search_fulltext_sphinx
$error = false;
}
-
+
/**
* Returns the name of this search backend to be displayed to administrators
*
@@ -99,6 +174,36 @@ class phpbb_search_fulltext_sphinx
}
/**
+ * Returns the search_query
+ *
+ * @return string search query
+ */
+ public function get_search_query()
+ {
+ return $this->search_query;
+ }
+
+ /**
+ * Returns false as there is no word_len array
+ *
+ * @return false
+ */
+ public function get_word_length()
+ {
+ return false;
+ }
+
+ /**
+ * Returns an empty array as there are no common_words
+ *
+ * @return array common words that are ignored by search backend
+ */
+ public function get_common_words()
+ {
+ return array();
+ }
+
+ /**
* Checks permissions and paths, if everything is correct it generates the config file
*
* @return string|bool Language key of the error/incompatiblity encountered, or false if successful
@@ -330,7 +435,7 @@ class phpbb_search_fulltext_sphinx
}
/**
- * Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
+ * Performs a search on keywords depending on display specific params. You have to run split_keywords() first
*
* @param string $type contains either posts or topics depending on what should be searched for
* @param string $fields contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
@@ -759,23 +864,23 @@ class phpbb_search_fulltext_sphinx
$tpl = '
<span class="error">' . $this->user->lang['FULLTEXT_SPHINX_CONFIGURE']. '</span>
<dl>
- <dt><label for="fulltext_sphinx_data_path">' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH_EXPLAIN'] . '</span></dt>
+ <dt><label for="fulltext_sphinx_data_path">' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_DATA_PATH_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_sphinx_data_path" type="text" size="40" maxlength="255" name="config[fulltext_sphinx_data_path]" value="' . $this->config['fulltext_sphinx_data_path'] . '" /></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>
+ <dt><label for="fulltext_sphinx_host">' . $this->user->lang['FULLTEXT_SPHINX_HOST'] . $this->user->lang['COLON'] . '</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>
+ <dt><label for="fulltext_sphinx_port">' . $this->user->lang['FULLTEXT_SPHINX_PORT'] . $this->user->lang['COLON'] . '</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>
<dl>
- <dt><label for="fulltext_sphinx_indexer_mem_limit">' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '</span></dt>
+ <dt><label for="fulltext_sphinx_indexer_mem_limit">' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '</span></dt>
<dd><input id="fulltext_sphinx_indexer_mem_limit" type="text" size="4" maxlength="10" name="config[fulltext_sphinx_indexer_mem_limit]" value="' . $this->config['fulltext_sphinx_indexer_mem_limit'] . '" />' . $this->user->lang['MIB'] . '</dd>
</dl>
<dl>
- <dt><label for="fulltext_sphinx_config_file">' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE'] . ':</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '</dt>
+ <dt><label for="fulltext_sphinx_config_file">' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '</dt>
<dd>' . (($this->config_generate()) ? '<textarea readonly="readonly" rows="6">' . $this->config_file_data . '</textarea>' : $this->config_file_data) . '</dd>
<dl>
';