[search] Remove unused SpecialSearch functions
authorErik Bernhardson <ebernhardson@wikimedia.org>
Mon, 7 Nov 2016 22:42:47 +0000 (14:42 -0800)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Mon, 7 Nov 2016 23:00:48 +0000 (15:00 -0800)
AFAICT SpecialSearch is never extended into anything else. These
functions are protected, an unused within this class. There are a couple
other public functions that look unused, but i suppose a hook consumer
could be using them so leaving in for now.

Change-Id: I214c6144f81dade14a0a8c616743191a295b716d

includes/specials/SpecialSearch.php

index 252ac31..f301e7c 100644 (file)
@@ -469,25 +469,6 @@ class SpecialSearch extends SpecialPage {
                return "<p class=\"mw-search-interwiki-header mw-search-visualclear\">\n$wikiMsg</p>";
        }
 
-       /**
-        * Decide if the suggested query should be run, and it's results returned
-        * instead of the provided $textMatches
-        *
-        * @param SearchResultSet $textMatches The results of a users query
-        * @return bool
-        */
-       protected function shouldRunSuggestedQuery( SearchResultSet $textMatches ) {
-               if ( !$this->runSuggestion ||
-                       !$textMatches->hasSuggestion() ||
-                       $textMatches->numRows() > 0 ||
-                       $textMatches->searchContainedSyntax()
-               ) {
-                       return false;
-               }
-
-               return $this->getConfig()->get( 'SearchRunSuggestedQuery' );
-       }
-
        /**
         * Generates HTML shown to the user when we have a suggestion about a query
         * that might give more results than their current query.
@@ -1332,23 +1313,6 @@ class SpecialSearch extends SpecialPage {
                return false;
        }
 
-       /**
-        * Check if query starts with all: prefix
-        *
-        * @param string $term The string to check
-        * @return bool
-        */
-       protected function startsWithAll( $term ) {
-               $allkeyword = $this->msg( 'searchall' )->inContentLanguage()->text();
-
-               $parts = explode( ':', $term );
-               if ( count( $parts ) > 1 ) {
-                       return $parts[0] == $allkeyword;
-               }
-
-               return false;
-       }
-
        /**
         * @since 1.18
         *