1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 14:30:32 +02:00

Merge PR #956 branch 'dhruvgoel92/ticket/11051' into develop

* dhruvgoel92/ticket/11051:
  [ticket/11051] fix spaces
  [ticket/11051] add common_words variable
  [ticket/11051] remove unnecessary comment
  [ticket/11051] add get_word_len() in sphinx search
  [ticket/11051] use get_word_length in search backend
  [ticket/11051] use get_common_words in search backend
  [ticket/11051] function instead of accessing property in search
  [ticket/11051] add public functions for public properties
This commit is contained in:
Oleg Pudeyev
2012-10-10 00:39:29 -04:00
5 changed files with 148 additions and 18 deletions

View File

@@ -27,9 +27,9 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
protected $config;
protected $db;
protected $user;
public $word_length = array();
public $search_query;
public $common_words = array();
protected $word_length = array();
protected $search_query;
protected $common_words = array();
/**
* Constructor
@@ -58,6 +58,36 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
return 'MySQL Fulltext';
}
/**
* 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
*

View File

@@ -23,9 +23,9 @@ if (!defined('IN_PHPBB'))
class phpbb_search_fulltext_native extends phpbb_search_base
{
protected $stats = array();
public $word_length = array();
public $search_query;
public $common_words = array();
protected $word_length = array();
protected $search_query;
protected $common_words = array();
protected $must_contain_ids = array();
protected $must_not_contain_ids = array();
@@ -73,6 +73,36 @@ class phpbb_search_fulltext_native extends phpbb_search_base
return 'phpBB Native Fulltext';
}
/**
* 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.
*

View File

@@ -31,9 +31,9 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
protected $config;
protected $db;
protected $user;
public $search_query;
public $common_words = array();
public $word_length = array();
protected $search_query;
protected $common_words = array();
protected $word_length = array();
/**
* Constructor
@@ -72,6 +72,36 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
return 'PostgreSQL Fulltext';
}
/**
* 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
*

View File

@@ -42,8 +42,8 @@ class phpbb_search_fulltext_sphinx
protected $dbtype;
protected $user;
protected $config_file_data = '';
public $search_query;
public $common_words = array();
protected $search_query;
protected $common_words = array();
/**
* Constructor
@@ -87,7 +87,7 @@ class phpbb_search_fulltext_sphinx
$error = false;
}
/**
* Returns the name of this search backend to be displayed to administrators
*
@@ -98,6 +98,36 @@ class phpbb_search_fulltext_sphinx
return 'Sphinx Fulltext';
}
/**
* 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 the common_words array
*
* @return array common words that are ignored by search backend
*/
public function get_common_words()
{
return $this->common_words;
}
/**
* Checks permissions and paths, if everything is correct it generates the config file
*