* @ingroup Search
*/
class SearchResultSet {
+ protected $containedSyntax = false;
+
+ public function __construct( $containedSyntax = false ) {
+ $this->containedSyntax = $containedSyntax;
+ }
+
/**
* Fetch an array of regular expression fragments for matching
* the search terms as parsed by this engine in a text extract.
* @return bool
*/
public function searchContainedSyntax() {
- return false;
+ return $this->containedSyntax;
}
}
return false;
}
- return SearchResult::newFromRow( $row );
+ return SearchResult::newFromTitle(
+ Title::makeTitle( $row->page_namespace, $row->page_title )
+ );
}
function free() {
}
function getTotalHits() {
- return $this->totalHits;
+ if ( !is_null( $this->totalHits ) ) {
+ return $this->totalHits;
+ } else {
+ // Special:Search expects a number here.
+ return $this->numRows();
+ }
}
}