summaryrefslogtreecommitdiff
path: root/includes/search/SearchResultSet.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /includes/search/SearchResultSet.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/search/SearchResultSet.php')
-rw-r--r--includes/search/SearchResultSet.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php
index 406d322d..8d18b0e6 100644
--- a/includes/search/SearchResultSet.php
+++ b/includes/search/SearchResultSet.php
@@ -25,6 +25,12 @@
* @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.
@@ -55,6 +61,33 @@ class SearchResultSet {
}
/**
+ * Some search modes will run an alternative query that it thinks gives
+ * a better result than the provided search. Returns true if this has
+ * occured.
+ *
+ * @return bool
+ */
+ function hasRewrittenQuery() {
+ return false;
+ }
+
+ /**
+ * @return string|null The search the query was internally rewritten to,
+ * or null when the result of the original query was returned.
+ */
+ function getQueryAfterRewrite() {
+ return null;
+ }
+
+ /**
+ * @return string|null Same as self::getQueryAfterRewrite(), but in HTML
+ * and with changes highlighted. Null when the query was not rewritten.
+ */
+ function getQueryAfterRewriteSnippet() {
+ return null;
+ }
+
+ /**
* Some search modes return a suggested alternate term if there are
* no exact hits. Returns true if there is one on this set.
*
@@ -120,7 +153,7 @@ class SearchResultSet {
* @return bool
*/
public function searchContainedSyntax() {
- return false;
+ return $this->containedSyntax;
}
}