27 parent::__construct();
30 $this->totalHits = $total;
42 if ( $this->resultSet ===
false ) {
46 return $this->resultSet->numRows();
50 if ( $this->resultSet ===
false ) {
54 if ( $this->results ===
null ) {
56 $this->resultSet->rewind();
57 $terms = MediaWikiServices::getInstance()->getContentLanguage()
58 ->convertForSearchResult( $this->terms );
59 foreach ( $this->resultSet as $row ) {
61 Title::makeTitle( $row->page_namespace, $row->page_title ),
65 $this->results[] = $result;
72 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.