25 parent::__construct();
28 $this->totalHits = $total;
40 if ( $this->resultSet ===
false ) {
44 return $this->resultSet->numRows();
48 if ( $this->resultSet ===
false ) {
52 if ( $this->results ===
null ) {
54 $this->resultSet->rewind();
55 $terms = \MediaWiki\MediaWikiServices::getInstance()->getContentLanguage()
56 ->convertForSearchResult( $this->terms );
57 while ( ( $row = $this->resultSet->fetchObject() ) !==
false ) {
59 Title::makeTitle( $row->page_namespace, $row->page_title ),
63 $this->results[] = $result;
70 if ( !is_null( $this->totalHits ) ) {
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.