* PostgreSQL search engine
*
* Copyright © 2006-2007 Greg Sabino Mullane <greg@turnstep.com>
- * http://www.mediawiki.org/
+ * https://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Search engine hook base class for Postgres
* @ingroup Search
*/
-class SearchPostgres extends SearchEngine {
-
- /**
- * @var DatabasePostgres
- */
- protected $db;
- /**
- * Creates an instance of this class
- * @param $db DatabaseSqlite: database object
- */
- function __construct( $db ) {
- parent::__construct( $db );
- }
-
+class SearchPostgres extends SearchDatabase {
/**
* Perform a full text search query via tsearch2 and return a result set.
* Currently searches a page's current title (page.page_title) and
$searchstring = $this->parseQuery( $term );
## We need a separate query here so gin does not complain about empty searches
- $SQL = "SELECT to_tsquery($searchstring)";
- $res = $this->db->query( $SQL );
+ $sql = "SELECT to_tsquery($searchstring)";
+ $res = $this->db->query( $sql );
if ( !$res ) {
## TODO: Better output (example to catch: one 'two)
die( "Sorry, that was not a valid search string. Please go back and try again" );
function update( $pageid, $title, $text ) {
## We don't want to index older revisions
- $SQL = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN " .
+ $sql = "UPDATE pagecontent SET textvector = NULL WHERE old_id IN " .
"(SELECT rev_text_id FROM revision WHERE rev_page = " . intval( $pageid ) .
" ORDER BY rev_text_id DESC OFFSET 1)";
- $this->db->query( $SQL );
+ $this->db->query( $sql );
return true;
}
parent::__construct( $row );
$this->score = $row->score;
}
+
function getScore() {
return $this->score;
}