DCausse has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324752

Change subject: [cirrus] enable BM25 on all but wikis with spaceless languages 
[step 2/3]
......................................................................

[cirrus] enable BM25 on all but wikis with spaceless languages [step 2/3]

When codfw has been reindex we can switch traffic to codfw and
and activate the new features.

Bug: T152092
Change-Id: I705e4bc0017d62eb4d96818238f31aac874e9370
---
M tests/cirrusTest.php
M wmf-config/InitialiseSettings.php
2 files changed, 109 insertions(+), 35 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/52/324752/1

diff --git a/tests/cirrusTest.php b/tests/cirrusTest.php
index c42b3e7..b122268 100644
--- a/tests/cirrusTest.php
+++ b/tests/cirrusTest.php
@@ -10,7 +10,8 @@
                $this->assertArrayNotHasKey( 'wgCirrusSearchServers', $config );
                $this->assertArrayHasKey( 'wgCirrusSearchClusters', $config );
                $this->assertArrayHasKey( 'wgCirrusSearchDefaultCluster', 
$config );
-               $this->assertEquals( 'unittest', 
$config['wgCirrusSearchDefaultCluster'] );
+                // FIXME: switch back to 'unittest'
+               $this->assertEquals( 'codfw', 
$config['wgCirrusSearchDefaultCluster'] );
                $this->assertCount( 2, $config['wgCirrusSearchClusters'] );
 
                // testwiki writes to eqiad and codfw
@@ -259,22 +260,66 @@
                }
        }
 
-       public static function provideSimilarityByLanguage() {
+       public static function provideConfigByLanguage() {
                return [
-                       'zhwiki' => [ 'zhwiki', 'wiki', 'default' ],
-                       'zh_min_nanwikisource' => [ 'zh_min_nanwikisource', 
'wikisource', 'default' ],
-                       'zh_classicalwiki' => [ 'zh_classicalwiki', 'wiki', 
'default' ],
-                       'thwiktionary' => [ 'thwiktionary', 'wiktionary', 
'default' ],
-                       'zh_yuewiki' => [ 'zh_yuewiki', 'wiki', 'default' ],
-                       'enwiki' => [ 'enwiki', 'wiki', 'wmf_defaults' ],
-                       'frwiktionary' => [ 'frwiktionary', 'wiktionary', 
'wmf_defaults' ],
+                       'zhwiki' => [ 'zhwiki', 'wiki',
+                               [
+                                       'wmgCirrusSearchSimilarityProfile' => 
'default',
+                                       'wmgCirrusSearchRescoreProfile' => 
'classic',
+                                       
'wmgCirrusSearchFullTextQueryBuilderProfile' => 'default',
+                               ],
+                       ],
+                       'zh_min_nanwikisource' => [ 'zh_min_nanwikisource', 
'wikisource',
+                               [
+                                       'wmgCirrusSearchSimilarityProfile' => 
'default',
+                                       'wmgCirrusSearchRescoreProfile' => 
'classic',
+                                       
'wmgCirrusSearchFullTextQueryBuilderProfile' => 'default',
+                               ],
+                       ],
+                       'zh_classicalwiki' => [ 'zh_classicalwiki', 'wiki',
+                               [
+                                       'wmgCirrusSearchSimilarityProfile' => 
'default',
+                                       'wmgCirrusSearchRescoreProfile' => 
'classic',
+                                       
'wmgCirrusSearchFullTextQueryBuilderProfile' => 'default',
+                               ],
+                       ],
+                       'thwiktionary' => [ 'thwiktionary', 'wiktionary',
+                               [
+                                       'wmgCirrusSearchSimilarityProfile' => 
'default',
+                                       'wmgCirrusSearchRescoreProfile' => 
'classic',
+                                       
'wmgCirrusSearchFullTextQueryBuilderProfile' => 'default',
+                               ],
+                       ],
+                       'zh_yuewiki' => [ 'zh_yuewiki', 'wiki',
+                               [
+                                       'wmgCirrusSearchSimilarityProfile' => 
'default',
+                                       'wmgCirrusSearchRescoreProfile' => 
'classic',
+                                       
'wmgCirrusSearchFullTextQueryBuilderProfile' => 'default',
+                               ],
+                       ],
+                       'enwiki' => [ 'enwiki', 'wiki',
+                               [
+                                       'wmgCirrusSearchSimilarityProfile' => 
'wmf_defaults',
+                                       'wmgCirrusSearchRescoreProfile' => 
'wsum_inclinks_pv',
+                                       
'wmgCirrusSearchFullTextQueryBuilderProfile' => 'perfield_builder',
+                               ],
+                       ],
+                       'frwiktionary' => [ 'frwiktionary', 'wiktionary',
+                               [
+                                       'wmgCirrusSearchSimilarityProfile' => 
'wmf_defaults',
+                                       'wmgCirrusSearchRescoreProfile' => 
'wsum_inclinks',
+                                       
'wmgCirrusSearchFullTextQueryBuilderProfile' => 'perfield_builder',
+                               ],
+                       ],
                ];
        }
        /**
-        * @dataProvider provideSimilarityByLanguage
+        * @dataProvider provideConfigByLanguage
         */
-       public function testSimilarityByLanguage( $wiki, $type, 
$expectedSimilarity ) {
+       public function testConfigByLanguage( $wiki, $type, array 
$expectedConfValues ) {
                $config = $this->loadCirrusConfig( 'production', $wiki, $type );
-               $this->assertEquals( 
$config['wmgCirrusSearchSimilarityProfile'], $expectedSimilarity );
+               foreach( $expectedConfValues as $key => $val ) {
+                       $this->assertEquals( $config[$key], $val );
+               }
        }
 }
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index a11ff12..694868c 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -16721,11 +16721,11 @@
 ],
 
 'wmgCirrusSearchDefaultCluster' => [
-       'default' => 'local',
+       'default' => 'codfw',
 ],
 
 'wmgCirrusSearchClusterOverrides' => [
-       'default' => [],
+       'default' => ['completion' => 'eqiad'],
 ],
 
 'wmgCirrusSearchWriteClusters' => [
@@ -16777,32 +16777,61 @@
 ],
 
 'wmgCirrusSearchRescoreProfile' => [
-       'default' => 'classic',
+       'default' => 'wsum_inclinks',
        'commonswiki' => 'classic_noboostlinks',
        'enwiki' => 'wsum_inclinks_pv',
-       'arwiki' => 'wsum_inclinks',
-       'dewiki' => 'wsum_inclinks',
-       'eswiki' => 'wsum_inclinks',
-       'frwiki' => 'wsum_inclinks',
-       'itwiki' => 'wsum_inclinks',
-       'nlwiki' => 'wsum_inclinks',
-       'ruwiki' => 'wsum_inclinks',
-       'plwiki' => 'wsum_inclinks',
-       'ptwiki' => 'wsum_inclinks',
+       // Uses the lang tag, list of spaceless languages
+       // (see 
https://www.mediawiki.org/wiki/User:TJones_(WMF)/Notes/Spaceless_Writing_Systems_and_Wiki-Projects)
+       "bo" => "classic",
+       "dz" => "classic",
+       "gan" => "classic",
+       "ja" => "classic",
+       "km" => "classic",
+       "lo" => "classic",
+       "my" => "classic",
+       "th" => "classic",
+       "wuu" => "classic",
+       "zh" => "classic",
+       "zh-classical" => "classic", // should be deprecated in favor of lzh
+       "lzh" => "classic", // zh-classical
+       "zh-yue" => "classic", // should be deprecated in favor of yue
+       "yue" => "classic", // zh_yue
+       // This list below are languages that may use use mixed scripts
+       "bug" => "classic",
+       "cdo" => "classic",
+       "cr" => "classic",
+       "hak" => "classic",
+       "jv" => "classic",
+       "zh-min-nan" => "classic", // needs to support deprecated language code 
(e.g. zh_min_nanwikisource)
+       "nan" => "classic", // e.g. zh_min_nan
 ],
 
 'wmgCirrusSearchFullTextQueryBuilderProfile' => [
-       'default' => 'default',
-       'enwiki' => 'perfield_builder',
-       'arwiki' => 'perfield_builder',
-       'dewiki' => 'perfield_builder',
-       'eswiki' => 'perfield_builder',
-       'frwiki' => 'perfield_builder',
-       'itwiki' => 'perfield_builder',
-       'nlwiki' => 'perfield_builder',
-       'ruwiki' => 'perfield_builder',
-       'plwiki' => 'perfield_builder',
-       'ptwiki' => 'perfield_builder',
+       'default' => 'perfield_builder',
+       // Uses the lang tag, list of spaceless languages
+       // (see 
https://www.mediawiki.org/wiki/User:TJones_(WMF)/Notes/Spaceless_Writing_Systems_and_Wiki-Projects)
+       "bo" => "default",
+       "dz" => "default",
+       "gan" => "default",
+       "ja" => "default",
+       "km" => "default",
+       "lo" => "default",
+       "my" => "default",
+       "th" => "default",
+       "wuu" => "default",
+       "zh" => "default",
+       "zh-classical" => "default", // should be deprecated in favor of lzh
+       "lzh" => "default", // zh-classical
+       "zh-yue" => "default", // should be deprecated in favor of yue
+       "yue" => "default", // zh_yue
+       // This list below are languages that may use use mixed scripts
+       "bug" => "default",
+       "cdo" => "default",
+       "cr" => "default",
+       "hak" => "default",
+       "jv" => "default",
+       "zh-min-nan" => "default", // needs to support deprecated language code 
(e.g. zh_min_nanwikisource)
+       "nan" => "default", // e.g. zh_min_nan
 ],
 
 'wmgCirrusSearchIgnoreOnWikiBoostTemplates' => [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I705e4bc0017d62eb4d96818238f31aac874e9370
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: DCausse <dcau...@wikimedia.org>

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

Reply via email to