X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchPostgres.php;h=43fb0169d5e8502150a267500f04ad84a576c74f;hb=e3e8659cfc2bc1ffe775a52671acc0d10dbb8527;hp=cb81aaab566f67290d6a8ab71485dc1660e3ba27;hpb=dcf6955e5c7e5dd1aaf84b9fe207d0660fc577cd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index cb81aaab56..43fb0169d5 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -42,10 +42,6 @@ class SearchPostgres extends SearchDatabase { $olderror = error_reporting( E_ERROR ); $resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) ); error_reporting( $olderror ); - if ( !$resultSet ) { - // Needed for "Query requires full scan, GIN doesn't support it" - return new SearchResultTooMany(); - } return new PostgresSearchResultSet( $resultSet, $this->searchTerms ); } @@ -54,9 +50,6 @@ class SearchPostgres extends SearchDatabase { $olderror = error_reporting( E_ERROR ); $resultSet = $this->db->resultObject( $this->db->query( $q, 'SearchPostgres', true ) ); error_reporting( $olderror ); - if ( !$resultSet ) { - return new SearchResultTooMany(); - } return new PostgresSearchResultSet( $resultSet, $this->searchTerms ); } @@ -191,7 +184,7 @@ class SearchPostgres extends SearchDatabase { 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 textvector IS NOT NULL and 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 ); @@ -222,12 +215,8 @@ class PostgresSearchResult extends SearchResult { * @ingroup Search */ class PostgresSearchResultSet extends SqlSearchResultSet { - function __construct( $resultSet, $terms ) { - parent::__construct( $resultSet, $terms ); - } - function next() { - $row = $this->mResultSet->fetchObject(); + $row = $this->resultSet->fetchObject(); if ( $row === false ) { return false; } else {