mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-14 05:36:30 +02:00
[feature/postgresql-fulltext-search] remove phrase search code
Unused Code for phrase search removed as pgsql doesnt support it. An added message is displayed if user tries to perform exact phrase search. PHPBB3-9730
This commit is contained in:
@ -30,6 +30,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
|
||||
public $search_query;
|
||||
public $common_words = array();
|
||||
public $word_length = array();
|
||||
public $phrase_search = false;
|
||||
|
||||
public function __construct(&$error)
|
||||
{
|
||||
@ -110,39 +111,6 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
|
||||
preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches);
|
||||
$this->split_words = $matches[1];
|
||||
|
||||
// to allow phrase search, we need to concatenate quoted words
|
||||
$tmp_split_words = array();
|
||||
$phrase = '';
|
||||
foreach ($this->split_words as $word)
|
||||
{
|
||||
if ($phrase)
|
||||
{
|
||||
$phrase .= ' ' . $word;
|
||||
if (strpos($word, '"') !== false && substr_count($word, '"') % 2 == 1)
|
||||
{
|
||||
$tmp_split_words[] = $phrase;
|
||||
$phrase = '';
|
||||
}
|
||||
}
|
||||
else if (strpos($word, '"') !== false && substr_count($word, '"') % 2 == 1)
|
||||
{
|
||||
$phrase = $word;
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp_split_words[] = $word . ' ';
|
||||
}
|
||||
}
|
||||
if ($phrase)
|
||||
{
|
||||
$tmp_split_words[] = $phrase;
|
||||
}
|
||||
|
||||
$this->split_words = $tmp_split_words;
|
||||
|
||||
unset($tmp_split_words);
|
||||
unset($phrase);
|
||||
|
||||
foreach ($this->split_words as $i => $word)
|
||||
{
|
||||
$clean_word = preg_replace('#^[+\-|"]#', '', $word);
|
||||
|
Reference in New Issue
Block a user