From a82024c637bfcc4f000cb2e947d97dcdcdb5f791 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 10 Sep 2014 12:22:04 -0700 Subject: [PATCH] Remove "related" searches Poorly documented and never used anywhere properly. - No core search backend supports it. - MWSearch implements it but we've never turned it on. - SolrStore copies MWSearch but it doesn't even work. - CirrusSearch doesn't bother because it's silly. Change-Id: I8b052e8e772030fba6c361fdb2775b10a7f7a15a --- includes/api/ApiQuerySearch.php | 3 --- includes/search/SearchResult.php | 7 ------- includes/specials/SpecialSearch.php | 24 ++---------------------- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index be6bc68f19..6c5023780b 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -176,9 +176,6 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $vals['sectionsnippet'] = $result->getSectionSnippet(); } } - if ( isset( $prop['hasrelated'] ) && $result->hasRelated() ) { - $vals['hasrelated'] = ''; - } // Add item to results and see whether it fits $fit = $apiResult->addValue( array( 'query', $this->getModuleName() ), diff --git a/includes/search/SearchResult.php b/includes/search/SearchResult.php index 1d28691c83..c6d5d4ffc1 100644 --- a/includes/search/SearchResult.php +++ b/includes/search/SearchResult.php @@ -242,13 +242,6 @@ class SearchResult { return strlen( $this->mText ); } - /** - * @return bool If hit has related articles - */ - function hasRelated() { - return false; - } - /** * @return string Interwiki prefix of the title (return iw even if title is broken) */ diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 3407476494..5cbc422cf1 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -673,26 +673,6 @@ class SpecialSearch extends SpecialPage { $date = $lang->userTimeAndDate( $timestamp, $this->getUser() ); - // link to related articles if supported - $related = ''; - if ( $result->hasRelated() ) { - $stParams = array_merge( - $this->powerSearchOptions(), - array( - 'search' => $this->msg( 'searchrelated' )->inContentLanguage()->text() . - ':' . $title->getPrefixedText(), - 'fulltext' => $this->msg( 'search' )->text() - ) - ); - - $related = ' -- ' . Linker::linkKnown( - $this->getPageTitle(), - $this->msg( 'search-relatedarticle' )->text(), - array(), - $stParams - ); - } - $fileMatch = ''; // Include a thumbnail for media files... if ( $title->getNamespace() == NS_FILE ) { @@ -718,7 +698,7 @@ class SpecialSearch extends SpecialPage { '' . "{$link} {$redirect} {$section} {$fileMatch}" . $extract . - "
{$desc} - {$date}{$related}
" . + "
{$desc} - {$date}
" . '' . '' . '' . @@ -738,7 +718,7 @@ class SpecialSearch extends SpecialPage { ) ) ) { $html = "
  • " . "{$link} {$redirect} {$section} {$fileMatch}
    {$extract}\n" . - "
    {$size} - {$date}{$related}
    " . + "
    {$size} - {$date}
    " . "
  • \n"; } -- 2.20.1