[Fusionforge-commits] r15379 - in branches/Branch_5_1: . src/common/search

Roland Mas lolando at fusionforge.org
Thu Apr 26 15:06:59 CEST 2012


Author: lolando
Date: 2012-04-26 15:06:58 +0200 (Thu, 26 Apr 2012)
New Revision: 15379

Modified:
   branches/Branch_5_1/
   branches/Branch_5_1/src/common/search/ForumSearchQuery.class.php
   branches/Branch_5_1/src/common/search/ForumsSearchQuery.class.php
Log:
Fixes in search: missing columns in SQL queries when use_fti=no

Modified: branches/Branch_5_1/src/common/search/ForumSearchQuery.class.php
===================================================================
--- branches/Branch_5_1/src/common/search/ForumSearchQuery.class.php	2012-04-26 12:25:13 UTC (rev 15378)
+++ branches/Branch_5_1/src/common/search/ForumSearchQuery.class.php	2012-04-26 13:06:58 UTC (rev 15379)
@@ -68,7 +68,7 @@
 		if (forge_get_config('use_fti')) {
 			$words = $this->getFTIwords();
 			$qpa = db_construct_qpa ($qpa,
-						 'SELECT x.* FROM (SELECT forum.msg_id, ts_headline(forum.subject, $1::tsquery) AS subject, forum.post_date, users.realname, forum.subject||$2||forum.body as full_string_agg, forum_idx.vectors FROM forum, users, to_tsquery($1) AS q, forum_idx WHERE forum.group_forum_id = $3 AND forum.posted_by = users.user_id AND forum_idx.msg_id = forum.msg_id GROUP BY forum.msg_id, subject, body, post_date, realname, forum_idx.vectors) AS x WHERE vectors @@ $1::tsquery ',
+						 'SELECT x.* FROM (SELECT forum.group_forum_id, forum.msg_id, ts_headline(forum.subject, $1::tsquery) AS subject, forum.post_date, users.realname, forum.subject||$2||forum.body as full_string_agg, forum_idx.vectors FROM forum, users, to_tsquery($1) AS q, forum_idx WHERE forum.group_forum_id = $3 AND forum.posted_by = users.user_id AND forum_idx.msg_id = forum.msg_id GROUP BY forum.msg_id, subject, body, post_date, realname, forum_idx.vectors) AS x WHERE vectors @@ $1::tsquery ',
 						 array ($words,
 							$this->field_separator,
 							$this->forumId)) ;
@@ -86,7 +86,7 @@
 						 array($words)) ;
 		} else {
 			$qpa = db_construct_qpa ($qpa,
-						 'SELECT x.* FROM (SELECT forum.msg_id, forum.subject, forum.post_date, users.realname, forum.subject||$1||forum.body as full_string_agg FROM forum,users WHERE users.user_id=forum.posted_by AND forum.group_forum_id=$2 GROUP BY msg_id, subject, post_date, realname, body) AS x WHERE ',
+						 'SELECT x.* FROM (SELECT forum.group_forum_id, forum.msg_id, forum.subject, forum.post_date, users.realname, forum.subject||$1||forum.body as full_string_agg FROM forum,users WHERE users.user_id=forum.posted_by AND forum.group_forum_id=$2 GROUP BY msg_id, subject, post_date, realname, body) AS x WHERE ',
 						 array ($this->field_separator,
 							$this->forumId)) ;
 			$qpa = $this->addIlikeCondition ($qpa, 'full_string_agg') ;

Modified: branches/Branch_5_1/src/common/search/ForumsSearchQuery.class.php
===================================================================
--- branches/Branch_5_1/src/common/search/ForumsSearchQuery.class.php	2012-04-26 12:25:13 UTC (rev 15378)
+++ branches/Branch_5_1/src/common/search/ForumsSearchQuery.class.php	2012-04-26 13:06:58 UTC (rev 15379)
@@ -108,7 +108,7 @@
 						 'ORDER BY forum_group_list.forum_name ASC, forum.msg_id ASC, ts_rank(vectors, q) DESC') ;
 		} else {
 			$qpa = db_construct_qpa ($qpa,
-						 'SELECT x.* FROM (SELECT forum.msg_id, forum.subject, forum.post_date, users.realname, forum_group_list.forum_name, forum.subject||$1||forum.body as full_string_agg FROM forum, users, forum_group_list WHERE users.user_id = forum.posted_by AND forum_group_list.group_forum_id = forum.group_forum_id AND forum_group_list.is_public <> 9 AND forum.group_forum_id IN (SELECT group_forum_id FROM forum_group_list WHERE group_id = $2) ',
+						 'SELECT x.* FROM (SELECT forum.group_forum_id, forum.msg_id, forum.subject, forum.post_date, users.realname, forum_group_list.forum_name, forum.subject||$1||forum.body as full_string_agg FROM forum, users, forum_group_list WHERE users.user_id = forum.posted_by AND forum_group_list.group_forum_id = forum.group_forum_id AND forum_group_list.is_public <> 9 AND forum.group_forum_id IN (SELECT group_forum_id FROM forum_group_list WHERE group_id = $2) ',
 						 array ($this->field_separator,
 							$this->groupId)) ;
 			if ($this->sections != SEARCH__ALL_SECTIONS) {




More information about the Fusionforge-commits mailing list