This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  696e0bc670f21b3e42aa63000d3e98375203dcf0 (commit)
      from  af8b968a2216c798a5d3d3639a4d39cc752d3750 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=696e0bc670f21b3e42aa63000d3e98375203dcf0

commit 696e0bc670f21b3e42aa63000d3e98375203dcf0
Author: Franck Villaume <[email protected]>
Date:   Mon May 30 19:55:40 2016 +0200

    docman: fix search with version

diff --git a/src/common/docman/views/search.php 
b/src/common/docman/views/search.php
index 061031d..14baefc 100644
--- a/src/common/docman/views/search.php
+++ b/src/common/docman/views/search.php
@@ -178,7 +178,7 @@ if(!isset($paging) || !$paging)
 
 if ($searchString) {
        $docsHtmlSearchRenderer = new DocsHtmlSearchRenderer($searchString, 
$start, $isExact, $group_id, SEARCH__ALL_SECTIONS, $paging, $search_options);
-       $result = 
$this->searchQuery->getData($this->searchQuery->getRowsPerPage(),$this->searchQuery->getOffset());
+       $result = 
$docsHtmlSearchRenderer->searchQuery->getData($docsHtmlSearchRenderer->searchQuery->getRowsPerPage(),$docsHtmlSearchRenderer->searchQuery->getOffset());
        $nbDocs = count($result);
        $max = $docsHtmlSearchRenderer->searchQuery->getRowsTotalCount();
        echo $HTML->paging_top($start, $paging, $nbDocs, $max, 
$redirect_url.'&view=search&textsearch='.$searchString);
diff --git a/src/common/search/DocsSearchQuery.class.php 
b/src/common/search/DocsSearchQuery.class.php
index 3fabe5e..5fb938b 100644
--- a/src/common/search/DocsSearchQuery.class.php
+++ b/src/common/search/DocsSearchQuery.class.php
@@ -74,23 +74,23 @@ class DocsSearchQuery extends SearchQuery {
                $params['options'] = $options;
                plugin_hook_by_reference('docmansearch_has_hierarchy', $params);
                if (count($params['groupIdArr'])) {
-                       $qpa = db_construct_qpa($qpa, ' AND doc_data.group_id = 
ANY ($1) ', array(db_int_array_to_any_clause($params['groupIdArr'])));
+                       $qpa = db_construct_qpa($qpa, ' AND docdata_vw.group_id 
= ANY ($1) ', array(db_int_array_to_any_clause($params['groupIdArr'])));
                }
                if ($sections != SEARCH__ALL_SECTIONS) {
                        $qpa = db_construct_qpa($qpa, ' AND 
doc_groups.doc_group = ANY ($1)', array(db_int_array_to_any_clause($sections)));
                }
                if ($this->showNonPublic) {
-                       $qpa = db_construct_qpa($qpa, ' AND doc_data.stateid IN 
(1, 3, 4, 5)');
+                       $qpa = db_construct_qpa($qpa, ' AND docdata_vw.stateid 
IN (1, 3, 4, 5)');
                } else {
-                       $qpa = db_construct_qpa($qpa, ' AND doc_data.stateid = 
1 AND doc_groups.stateid = 1');
+                       $qpa = db_construct_qpa($qpa, ' AND docdata_vw.stateid 
= 1 AND doc_groups.stateid = 1');
                }
 
                if (isset($options['date_begin']) && 
!isset($options['date_end'])) {
-                       $qpa = db_construct_qpa($qpa, ' AND doc_data.createdate 
>= $1', array($options['date_begin']));
+                       $qpa = db_construct_qpa($qpa, ' AND 
docdata_vw.createdate >= $1', array($options['date_begin']));
                } elseif (!isset($options['date_begin']) && 
isset($options['date_end'])) {
-                       $qpa = db_construct_qpa($qpa, ' AND doc_data.createdate 
<= $1', array($options['date_end']));
+                       $qpa = db_construct_qpa($qpa, ' AND 
docdata_vw.createdate <= $1', array($options['date_end']));
                } elseif (isset($options['date_begin']) && 
isset($options['date_end'])) {
-                       $qpa = db_construct_qpa($qpa, ' AND doc_data.createdate 
between $1 and $2', array($options['date_begin'], $$options['date_end']));
+                       $qpa = db_construct_qpa($qpa, ' AND 
docdata_vw.createdate between $1 and $2', array($options['date_begin'], 
$$options['date_end']));
                }
                return $qpa;
        }
@@ -104,10 +104,10 @@ class DocsSearchQuery extends SearchQuery {
                $words = $this->getFTIwords();
                $options = $this->options;
                if (!isset($options['insideDocuments']) || 
!$options['insideDocuments']) {
-                       $qpa = db_construct_qpa(false, 'SELECT x.* FROM (SELECT 
doc_data.docid, doc_data.group_id AS group_id, doc_data.filename, 
ts_headline(doc_data.title, q) AS title, ts_headline(doc_data.description, q) 
AS description, doc_groups.groupname, doc_data.title||$1||description AS 
full_string_agg, doc_data_idx.vectors, groups.group_name as project_name FROM 
groups, doc_data, doc_groups, doc_data_idx, to_tsquery($2) AS q WHERE 
doc_data.doc_group = doc_groups.doc_group AND doc_data.group_id = 
groups.group_id AND doc_data.docid = doc_data_idx.docid AND (vectors @@ 
to_tsquery($2))',
+                       $qpa = db_construct_qpa(false, 'SELECT x.* FROM (SELECT 
docdata_vw.docid, docdata_vw.group_id AS group_id, docdata_vw.filename, 
ts_headline(docdata_vw.title, q) AS title, ts_headline(docdata_vw.description, 
q) AS description, doc_groups.groupname, docdata_vw.title||$1||description AS 
full_string_agg, doc_data_idx.vectors, groups.group_name as project_name FROM 
groups, docdata_vw, doc_groups, doc_data_idx, to_tsquery($2) AS q WHERE 
docdata_vw.doc_group = doc_groups.doc_group AND docdata_vw.group_id = 
groups.group_id AND docdata_vw.docid = doc_data_idx.docid AND (vectors @@ 
to_tsquery($2))',
                                        array ($this->field_separator, $words));
                } else {
-                       $qpa = db_construct_qpa(false, 'SELECT x.* FROM (SELECT 
doc_data.docid, doc_data.group_id AS group_id, ts_headline(doc_data.filename, 
q) AS filename, ts_headline(doc_data.title, q) AS title, 
ts_headline(doc_data.description, q) AS description, doc_groups.groupname, 
doc_data.title||$1||description||$1||filename AS full_string_agg, 
doc_data_words_idx.vectors, groups.group_name as project_name FROM groups, 
doc_data, doc_groups, doc_data_words_idx, to_tsquery($2) AS q WHERE 
doc_data.doc_group = doc_groups.doc_group AND doc_data.group_id = 
groups.group_id AND doc_data.docid = doc_data_words_idx.docid AND (vectors @@ 
to_tsquery($2))',
+                       $qpa = db_construct_qpa(false, 'SELECT x.* FROM (SELECT 
docdata_vw.docid, docdata_vw.group_id AS group_id, 
ts_headline(docdata_vw.filename, q) AS filename, ts_headline(docdata_vw.title, 
q) AS title, ts_headline(docdata_vw.description, q) AS description, 
doc_groups.groupname, docdata_vw.title||$1||description||$1||filename AS 
full_string_agg, doc_data_words_idx.vectors, groups.group_name as project_name 
FROM groups, docdata_vw, doc_groups, doc_data_words_idx, to_tsquery($2) AS q 
WHERE docdata_vw.doc_group = doc_groups.doc_group AND docdata_vw.group_id = 
groups.group_id AND docdata_vw.docid = doc_data_words_idx.docid AND (vectors @@ 
to_tsquery($2))',
                                        array ($this->field_separator, $words));
                }
                $qpa = $this->addCommonQPA($qpa);
@@ -119,6 +119,7 @@ class DocsSearchQuery extends SearchQuery {
                $qpa = db_construct_qpa($qpa, ' ORDER BY ts_rank(vectors, 
to_tsquery($1)) DESC, group_id ASC, groupname ASC, title ASC',
                                         array($words));
 
+               var_dump($qpa);
                return $qpa;
        }
 

-----------------------------------------------------------------------

Summary of changes:
 src/common/docman/views/search.php          |  2 +-
 src/common/search/DocsSearchQuery.class.php | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to