getInterwikiResults() != null; } /** * Fetches next search result, or false. * STUB * * @return SearchResult */ function next() { return false; } /** * Frees the result set, if applicable. */ function free() { // ... } /** * Did the search contain search syntax? If so, Special:Search won't offer * the user a link to a create a page named by the search string because the * name would contain the search syntax. */ public function searchContainedSyntax() { return false; } } /** * This class is used for different SQL-based search engines shipped with MediaWiki * @ingroup Search */ class SqlSearchResultSet extends SearchResultSet { protected $mResultSet; function __construct( $resultSet, $terms ) { $this->mResultSet = $resultSet; $this->mTerms = $terms; } function termMatches() { return $this->mTerms; } function numRows() { if ( $this->mResultSet === false ) { return false; } return $this->mResultSet->numRows(); } function next() { if ( $this->mResultSet === false ) { return false; } $row = $this->mResultSet->fetchObject(); if ( $row === false ) { return false; } return SearchResult::newFromRow( $row ); } function free() { if ( $this->mResultSet === false ) { return false; } $this->mResultSet->free(); } } /** * A SearchResultSet wrapper for SearchEngine::getNearMatch */ class SearchNearMatchResultSet extends SearchResultSet { private $fetched = false; /** * @param $match mixed Title if matched, else null */ public function __construct( $match ) { $this->result = $match; } public function hasResult() { return (bool)$this->result; } public function numRows() { return $this->hasResults() ? 1 : 0; } public function next() { if ( $this->fetched || !$this->result ) { return false; } $this->fetched = true; return SearchResult::newFromTitle( $this->result ); } }