jenkins-bot has submitted this change and it was merged. Change subject: Remove "related searches" from MWSearch ......................................................................
Remove "related searches" from MWSearch See core I8b052e8e. This is poorly implemented and documented and no one has ever used it. Change-Id: If98096f32d8efbe3388b988ed48eff1947c9d2e8 --- M MWSearch.php M MWSearch_body.php 2 files changed, 3 insertions(+), 20 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/MWSearch.php b/MWSearch.php index e7e6b70..ed23a3a 100644 --- a/MWSearch.php +++ b/MWSearch.php @@ -43,9 +43,6 @@ # Back-end version; set to 2.1 to add support for some advanced features. $wgLuceneSearchVersion = 2; -# If to show related links (if available) below search results -$wgLuceneUseRelated = false; - # If to use lucene as a prefix search backend $wgEnableLucenePrefixSearch = false; diff --git a/MWSearch_body.php b/MWSearch_body.php index 542c40a..07bb021 100644 --- a/MWSearch_body.php +++ b/MWSearch_body.php @@ -9,8 +9,8 @@ * @access public */ function searchText( $term ) { - return LuceneSearchSet::newFromQuery( isset($this->related)? 'related' : 'search', - $term, $this->namespaces, $this->limit, $this->offset, $this->searchingEverything() ); + return LuceneSearchSet::newFromQuery( 'search', $term, $this->namespaces, + $this->limit, $this->offset, $this->searchingEverything() ); } /** @@ -61,7 +61,7 @@ * @access private */ function replacePrefixes( $query ) { - global $wgContLang, $wgLuceneUseRelated; + global $wgContLang; wfProfileIn( __METHOD__ ); // quick check, most of the time we don't need any rewriting @@ -72,15 +72,6 @@ // "search everything" keyword $allkeyword = wfMessage('searchall')->inContentLanguage()->text(); - - // check if this is query for related articles - $relatedkey = wfMessage('searchrelated')->inContentLanguage()->text() . ':'; - if($wgLuceneUseRelated && strncmp($query, $relatedkey, strlen($relatedkey)) == 0){ - $this->related = true; - list($dummy,$ret) = explode(":",$query,2); - wfProfileOut( __METHOD__ ); - return trim($ret); - } global $wgCanonicalNamespaceNames, $wgNamespaceAliases; $nsNamesRaw = array_merge($wgContLang->getNamespaces(), $wgCanonicalNamespaceNames, @@ -408,11 +399,6 @@ if( is_null($this->mSize) ) return parent::getByteSize(); return $this->mSize; - } - - function hasRelated(){ - global $wgLuceneSearchVersion, $wgLuceneUseRelated; - return $wgLuceneSearchVersion >= 2.1 && $wgLuceneUseRelated; } } -- To view, visit https://gerrit.wikimedia.org/r/160019 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If98096f32d8efbe3388b988ed48eff1947c9d2e8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MWSearch Gerrit-Branch: master Gerrit-Owner: Chad <ch...@wikimedia.org> Gerrit-Reviewer: Chad <ch...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits