jenkins-bot has submitted this change and it was merged.

Change subject: Redo search configuration
......................................................................


Redo search configuration

Allows us to enable CirrusSearch on a per-wiki basis rather than
realm-wide. Also adds new testsearch100n hosts for production and
adds LuceneSearch to $wgSearchTypeAlternatives wikis (requires
I96a08c64 from core)

Change-Id: I8b8931aace3ce7ed50a41c76405a3d800137c97d
---
M wmf-config/CirrusSearch-common.php
A wmf-config/CirrusSearch-production.php
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings-labs.php
M wmf-config/InitialiseSettings.php
5 files changed, 46 insertions(+), 18 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, but someone else must approve
  Demon: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/CirrusSearch-common.php 
b/wmf-config/CirrusSearch-common.php
index 2778212..3484004 100644
--- a/wmf-config/CirrusSearch-common.php
+++ b/wmf-config/CirrusSearch-common.php
@@ -12,7 +12,13 @@
 # Contact Wikimedia operations or platform engineering for more details.
 
 require_once( "$IP/extensions/CirrusSearch/CirrusSearch.php" );
-$wgSearchType = 'CirrusSearch';
+if ( $wmgUseCirrusAsAlternative ) {
+       $wgSearchTypeAlternatives = array( 'CirrusSearch' );
+} else {
+       $wgSearchType = 'CirrusSearch';
+       $wgSearchTypeAlternatives = array( 'LuceneSearch' );
+       $wgEnableLucenePrefixSearch = false;
+}
 
 if ( $wmgUsePoolCounter ) {
        $wgPoolCounterConf['CirrusSearch-Update'] = array(
diff --git a/wmf-config/CirrusSearch-production.php 
b/wmf-config/CirrusSearch-production.php
new file mode 100644
index 0000000..25c6c05
--- /dev/null
+++ b/wmf-config/CirrusSearch-production.php
@@ -0,0 +1,12 @@
+<?php
+# WARNING: This file is publically viewable on the web. Do not put private 
data here.
+
+# This file holds the MediaWiki CirrusSearch configuration which is specific
+# to the 'production' realm.
+# It should be loaded AFTER CirrusSearch-common.php
+
+$wgCirrusSearchServers = array(
+       '10.64.32.138', # testsearch1001
+       '10.64.32.137', # testsearch1002
+       '10.64.32.136', # testsearch1003
+);
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index cad67cb..1dd8f02 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -875,26 +875,24 @@
 wfProfileOut( "$fname-misc2" );
 
 # :SEARCH:
-switch ( $wmfRealm ) {
-case 'labs':
+# This is overridden in the Lucene section below
+$wgDisableTextSearch   = true;
+$wgDisableSearchUpdate = true;
+
+# Better make sure the global setting is enabled
+$wgUseLuceneSearch = true;
+if ( $wgUseLuceneSearch ) {
+       wfProfileIn( "$fname-lucene" );
+       include( "$wmfConfigDir/lucene-common.php" );
+       wfProfileOut( "$fname-lucene" );
+}
+# New wikis are special and get Cirrus :)
+if ( $wmgUseCirrus || $wmgUseCirrusAsAlternative ) {
        wfProfileIn( "$fname-CirrusSearch" );
+       # Cirrus uses SearchUpdate, turn it back on
+       $wgDisableSearchUpdate = false;
        include( "$wmfConfigDir/CirrusSearch-common.php" );
        wfProfileOut( "$fname-CirrusSearch" );
-       break;
-case 'production':
-default:
-       # This is overridden in the Lucene section below
-       $wgDisableTextSearch   = true;
-       $wgDisableSearchUpdate = true;
-
-       # Better make sure the global setting is enabled
-       $wgUseLuceneSearch = true;
-       if ( $wgUseLuceneSearch ) {
-               wfProfileIn( "$fname-lucene" );
-               include( "$wmfConfigDir/lucene-common.php" );
-               wfProfileOut( "$fname-lucene" );
-       }
-       break;
 }
 
 // Case-insensitive title prefix search extension
diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 83e9af8..561ff0a 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -278,6 +278,10 @@
        'wgSearchSuggestCacheExpiry' => array(
                'default' => 1800,
        ),
+
+       'wmgUseCirrus' => array(
+               'default' => true,
+       ),
 );
 
 } # wmflLabsSettings()
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index fb9f255..c79ca83 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12513,6 +12513,14 @@
        'default' => true,
 ),
 
+'wmgUseCirrus' => array(
+       'default' => false,
+),
+
+'wmgUseCirrusAsAlternative' => array(
+       'default' => false,
+),
+
 ### End (roughly) of general extensions ########################
 
 // Apply blocks to IPs in XFF (bug 23343)

-- 
To view, visit https://gerrit.wikimedia.org/r/78083
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b8931aace3ce7ed50a41c76405a3d800137c97d
Gerrit-PatchSet: 4
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Demon <ch...@wikimedia.org>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Cmcmahon <cmcma...@wikimedia.org>
Gerrit-Reviewer: Demon <ch...@wikimedia.org>
Gerrit-Reviewer: Manybubbles <never...@wikimedia.org>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to