resultSet = $resultSet; $this->terms = $terms; $this->totalHits = $total; } /** * @return string[] * @deprecated since 1.34 */ public function termMatches() { return $this->terms; } public function numRows() { if ( $this->resultSet === false ) { return 0; } return $this->resultSet->numRows(); } public function extractResults() { if ( $this->resultSet === false ) { return []; } if ( $this->results === null ) { $this->results = []; $this->resultSet->rewind(); $terms = MediaWikiServices::getInstance()->getContentLanguage() ->convertForSearchResult( $this->terms ); foreach ( $this->resultSet as $row ) { $result = new SqlSearchResult( Title::makeTitle( $row->page_namespace, $row->page_title ), $terms ); $this->augmentResult( $result ); $this->results[] = $result; } } return $this->results; } public function getTotalHits() { if ( $this->totalHits !== null ) { return $this->totalHits; } else { // Special:Search expects a number here. return $this->numRows(); } } }