Change hard-coded vector fields to variables.
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 5 Jul 2006 04:11:20 +0000 (04:11 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 5 Jul 2006 04:11:20 +0000 (04:11 +0000)
includes/SearchPostgres.php

index cece4e3..8e36b0b 100644 (file)
@@ -99,7 +99,7 @@ class SearchPostgres extends SearchEngine {
 
                $query = "SELECT page_id, page_namespace, page_title, old_text AS page_text ".
                        "FROM page p, revision r, text t WHERE p.page_latest = r.rev_id " .
-                       "AND r.rev_text_id = t.old_id AND p.vector @@ to_tsquery('$match')";
+                       "AND r.rev_text_id = t.old_id AND $fulltext @@ to_tsquery('$match')";
 
                ## Redirects
                if (! $this->showRedirects)
@@ -113,7 +113,7 @@ class SearchPostgres extends SearchEngine {
                        $query .=  " AND page_namespace IN ($namespaces)";
                }
 
-               $query .= " ORDER BY rank(p.vector, to_tsquery('$fulltext')) DESC";
+               $query .= " ORDER BY rank($fulltext, to_tsquery('$fulltext')) DESC";
 
                $query .= $this->db->limitResult( '', $this->limit, $this->offset );