26 parent::__construct();
29 $this->totalHits = $total;
41 if ( $this->resultSet ===
false ) {
45 return $this->resultSet->numRows();
49 if ( $this->resultSet ===
false ) {
53 if ( $this->results ===
null ) {
55 $this->resultSet->rewind();
56 $terms = MediaWikiServices::getInstance()->getContentLanguage()
57 ->convertForSearchResult( $this->terms );
58 while ( ( $row = $this->resultSet->fetchObject() ) !==
false ) {
60 Title::makeTitle( $row->page_namespace, $row->page_title ),
64 $this->results[] = $result;
71 if ( $this->totalHits !==
null ) {
SearchResult[] $results
Cache of results - serialization of the result iterator as an array.
This class is used for different SQL-based search engines shipped with MediaWiki.
getTotalHits()
Some search modes return a total hit count for the query in the entire article database.
__construct(IResultWrapper $resultSet, array $terms, $total=null)
int null $totalHits
Total number of hits for $terms.
IResultWrapper $resultSet
@noinspection PhpMissingParentConstructorInspection
string[] $terms
Requested search query.
extractResults()
Extract all the results in the result set as array.
augmentResult(SearchResult $result)
Returns extra data for specific result and store it in SearchResult object.