From: Greg Sabino Mullane Date: Sun, 14 Jan 2007 22:57:31 +0000 (+0000) Subject: Don't index old versions via tsearch2 X-Git-Tag: 1.31.0-rc.0~54399 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=65695331508647768fc48d2b46ae7c4b5f36e814;p=lhc%2Fweb%2Fwiklou.git Don't index old versions via tsearch2 --- diff --git a/includes/SearchPostgres.php b/includes/SearchPostgres.php index 457636b481..c202f911e6 100644 --- a/includes/SearchPostgres.php +++ b/includes/SearchPostgres.php @@ -124,7 +124,15 @@ class SearchPostgres extends SearchEngine { ## These two functions are done automatically via triggers - function update( $id, $title, $text ) { return true; } + function update( $pageid, $title, $text ) { + $dbw =& wfGetDB( DB_MASTER ); + ## We don't want to index older revisions + $SQL = "UPDATE pagecontent SET textvector = NULL WHERE old_id = ". + "(SELECT rev_text_id FROM revision WHERE rev_page = $pageid ". + "ORDER BY rev_text_id DESC LIMIT 1 OFFSET 1)"; + $dbw->doQuery($SQL); + return true; + } function updateTitle( $id, $title ) { return true; } } ## end of the SearchPostgres class