MediaWiki master
ISearchResultSet.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Search;
4
7
17interface ISearchResultSet extends \Countable, \IteratorAggregate {
22 public const SECONDARY_RESULTS = 0;
23
28 public const INLINE_RESULTS = 1;
29
33 public function numRows();
34
45 public function getTotalHits();
46
55 public function isApproximateTotalHits(): bool;
56
68 public function hasRewrittenQuery();
69
74 public function getQueryAfterRewrite();
75
83 public function getQueryAfterRewriteSnippet();
84
91 public function hasSuggestion();
92
96 public function getSuggestionQuery();
97
105 public function getSuggestionSnippet();
106
113 public function getInterwikiResults( $type = self::SECONDARY_RESULTS );
114
121 public function hasInterwikiResults( $type = self::SECONDARY_RESULTS );
122
129 public function searchContainedSyntax();
130
134 public function hasMoreResults();
135
140 public function shrink( $limit );
141
146 public function extractResults();
147
152 public function extractTitles();
153
159 public function setAugmentedData( $name, $data );
160
164 public function augmentResult( SearchResult $result );
165
172 public function getOffset();
173}
174
176class_alias( ISearchResultSet::class, 'ISearchResultSet' );
An abstract base class representing a search engine result.
Represents a title within MediaWiki.
Definition Title.php:69
Marks HTML that shouldn't be escaped.
Definition HtmlArmor.php:18
A set of SearchEngine results.
hasSuggestion()
Some search modes return a suggested alternate term if there are no exact hits.
isApproximateTotalHits()
If getTotalHits() is supported determine whether this number is approximate or not.
getInterwikiResults( $type=self::SECONDARY_RESULTS)
Return a result set of hits on other (multiple) wikis associated with this one.
hasInterwikiResults( $type=self::SECONDARY_RESULTS)
Check if there are results on other wikis.
augmentResult(SearchResult $result)
Returns extra data for specific result and store it in SearchResult object.
getTotalHits()
Some search modes return a total hit count for the query in the entire article database.
setAugmentedData( $name, $data)
Sets augmented data for result set.
const INLINE_RESULTS
Identifier for interwiki results that can be displayed even if no existing main wiki results exist.
searchContainedSyntax()
Did the search contain search syntax? If so, Special:Search won't offer the user a link to a create a...
extractResults()
Extract all the results in the result set as array.
extractTitles()
Extract all the titles in the result set.
const SECONDARY_RESULTS
Identifier for interwiki results that are displayed only together with existing main wiki results.
hasRewrittenQuery()
Some search modes will run an alternative query that it thinks gives a better result than the provide...
Definition of a mapping for the search index field.