From 65695331508647768fc48d2b46ae7c4b5f36e814 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Sun, 14 Jan 2007 22:57:31 +0000 Subject: [PATCH] Don't index old versions via tsearch2 --- includes/SearchPostgres.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.20.1