58 if ( static::class === self::class ) {
69 return $this->
count();
183 if ( $this->
count() > $limit ) {
189 if ( is_array( $this->results ) ) {
190 $this->results = array_slice( $this->results, 0, $limit );
192 throw new \UnexpectedValueException(
193 "When overriding result store extending classes must "
194 .
" also override " . __METHOD__ );
204 if ( is_null( $this->results ) ) {
211 while ( ( $result = $this->
next() ) !=
false ) {
212 $this->results[] = $result;
224 if ( is_null( $this->titles ) ) {
229 $this->titles = array_map(
231 return $result->getTitle();
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
BaseSearchResultSet is the base class that must be extended by SearchEngine search result set impleme...
next()
Fetches next search result, or false.
rewind()
Rewind result set back to beginning.
hasInterwikiResults( $type=self::SECONDARY_RESULTS)
Check if there are results on other wikis.
getTotalHits()
Some search modes return a total hit count for the query in the entire article database.
getInterwikiResults( $type=self::SECONDARY_RESULTS)
Return a result set of hits on other (multiple) wikis associated with this one.
boolean $hasMoreResults
True when there are more pages of search results available.
searchContainedSyntax()
Did the search contain search syntax? If so, Special:Search won't offer the user a link to a create a...
hasRewrittenQuery()
Some search modes will run an alternative query that it thinks gives a better result than the provide...
Title[] $titles
Cache of titles.
getQueryAfterRewriteSnippet()
__construct( $containedSyntax=false, $hasMoreResults=false)
extractResults()
Extract all the results in the result set as array.
hasSuggestion()
Some search modes return a suggested alternate term if there are no exact hits.
extractTitles()
Extract all the titles in the result set.
SearchResult[] $results
Cache of results - serialization of the result iterator as an array.
NOTE: this class is being refactored into an abstract base class.
Represents a title within MediaWiki.
trait SearchResultSetTrait
Trait useful for SearchResultSet implementations.