Support interwiki searches in API
[lhc/web/wiklou.git] / includes / search / SearchEngine.php
index 2b149cd..debf01b 100644 (file)
@@ -65,16 +65,6 @@ class SearchEngine {
                return null;
        }
 
-       /**
-        * If this search backend can list/unlist redirects
-        * @deprecated since 1.18 Call supports( 'list-redirects' );
-        * @return bool
-        */
-       function acceptListRedirects() {
-               wfDeprecated( __METHOD__, '1.18' );
-               return $this->supports( 'list-redirects' );
-       }
-
        /**
         * @since 1.18
         * @param $feature String
@@ -324,7 +314,7 @@ class SearchEngine {
                        $this->namespaces = null;
                        $parsed = substr( $query, strlen( $allkeyword ) );
                } elseif ( strpos( $query, ':' ) !== false ) {
-                       $prefix = substr( $query, 0, strpos( $query, ':' ) );
+                       $prefix = str_replace( ' ', '_', substr( $query, 0, strpos( $query, ':' ) ) );
                        $index = $wgContLang->getNsIndex( $prefix );
                        if ( $index !== false ) {
                                $this->namespaces = array( $index );
@@ -682,6 +672,15 @@ class SearchResultSet {
        function free() {
                // ...
        }
+
+       /**
+        * Did the search contain search syntax?  If so, Special:Search won't offer
+        * the user a link to a create a page named by the search string because the
+        * name would contain the search syntax.
+        */
+       public function searchContainedSyntax() {
+               return false;
+       }
 }
 
 /**
@@ -975,6 +974,13 @@ class SearchResult {
                return '';
        }
 
+       /**
+        * @return string interwiki namespace of the title (since we likely can't resolve it locally)
+        */
+       function getInterwikiNamespaceText() {
+               return '';
+       }
+
        /**
         * Did this match file contents (eg: PDF/DJVU)?
         */