$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)
$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 );