1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-19 07:08:09 +01:00

[feature/postgresql-fulltext-search] supports_phrase_search function

function to return the value of the the private property phrase_search

PHPBB3-9730
This commit is contained in:
Dhruv Goel 2012-07-03 03:54:01 +05:30 committed by unknown
parent 7a2d36a25e
commit 70a0caee28
2 changed files with 15 additions and 3 deletions

View File

@ -27,10 +27,10 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
private $tsearch_usable = false;
private $version;
private $tsearch_query;
private $phrase_search = false;
public $search_query;
public $common_words = array();
public $word_length = array();
public $phrase_search = false;
/**
* Constructor
@ -70,6 +70,18 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
return 'PostgreSQL Fulltext';
}
/**
* Returns if phrase search is supported or not
*
* @return bool
*
* @access public
*/
public function supports_phrase_search()
{
return $this->phrase_search;
}
/**
* Checks for correct PostgreSQL version and stores min/max word length in the config
*

View File

@ -598,9 +598,9 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Check if search backend supports phrase search or not
$phrase_search_disabled = '';
if (strpos(html_entity_decode($keywords), '"') !== false && isset($search->phrase_search))
if (strpos(html_entity_decode($keywords), '"') !== false && method_exists($search, 'supports_phrase_search'))
{
$phrase_search_disabled = $search->phrase_search ? false : true;
$phrase_search_disabled = $search->supports_phrase_search() ? false : true;
}
$template->assign_vars(array(