aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/search/fulltext_postgres.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-11-09 14:01:20 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-11-09 14:01:20 -0500
commitd99a0fe6b1dd984dfbba3bafd0e7a0d78234ddc5 (patch)
tree9d1d7225361c55dd6c4c3866874edca67788aff6 /phpBB/includes/search/fulltext_postgres.php
parent5382c838ba46e22aa51aef1ca4bef9c16866e7f5 (diff)
parenta509a8ed2d921d4797e08531e70ba70afb167d9d (diff)
downloadforums-d99a0fe6b1dd984dfbba3bafd0e7a0d78234ddc5.tar
forums-d99a0fe6b1dd984dfbba3bafd0e7a0d78234ddc5.tar.gz
forums-d99a0fe6b1dd984dfbba3bafd0e7a0d78234ddc5.tar.bz2
forums-d99a0fe6b1dd984dfbba3bafd0e7a0d78234ddc5.tar.xz
forums-d99a0fe6b1dd984dfbba3bafd0e7a0d78234ddc5.zip
Merge PR #949 branch 'dhruvgoel92/ticket/11050' into develop
* dhruvgoel92/ticket/11050: [ticket/11050] make all properties protected in all search backends [ticket/11050] get_common_words() returns empty array for sphinx [ticket/11050] fix tidied search query docblock language [ticket/11050] fix min/max length docblock language [ticket/11050] multi sentences separated by period in docblocks [ticket/11050] fix separated spelling in docblock [ticket/11050] fix split words doc block language [ticket/11050] remove class word from docblocks [ticket/11050] add missing @var in native search [ticket/11050] replace user by phpbb_user [ticket/11050] fix minor comment/docblocks issues [ticket/11050] add access specifiers to native search properties [ticket/11050] fix docblocks with description before @var [ticket/11050] add missing @var [ticket/11050] remove common_words property from sphinx [ticket/11050] add access specifiers to sphinx search properties [ticket/11050] add access specifiers to mysql search properties [ticket/11050] add access specifiers to pgsql search properties
Diffstat (limited to 'phpBB/includes/search/fulltext_postgres.php')
-rw-r--r--phpBB/includes/search/fulltext_postgres.php72
1 files changed, 67 insertions, 5 deletions
diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php
index 38989a9d9a..12a1203249 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;
+
+ /**
+ * 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
*/
@@ -254,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)
@@ -275,7 +337,7 @@ 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, $m_approve_fid_ary, $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;
@@ -459,7 +521,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, $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;
@@ -602,7 +664,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