jenkins-bot has submitted this change and it was merged.
Change subject: Enable ICU folding for en, fr and greek by default
......................................................................
Enable ICU folding for en, fr and greek by default
Bug: T146402
Change-Id: I2670d4130db351fc6b8f7c84172a8c9c6d07a181
---
M includes/Maintenance/AnalysisConfigBuilder.php
M tests/unit/Maintenance/AnalysisConfigBuilderTest.php
2 files changed, 15 insertions(+), 1 deletion(-)
Approvals:
Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
Tjones: Looks good to me, approved
EBernhardson: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/includes/Maintenance/AnalysisConfigBuilder.php
b/includes/Maintenance/AnalysisConfigBuilder.php
index 831d34a..00aec8f 100644
--- a/includes/Maintenance/AnalysisConfigBuilder.php
+++ b/includes/Maintenance/AnalysisConfigBuilder.php
@@ -909,7 +909,14 @@
* @var bool[] indexed by language code, languages where ICU folding
* can be enabled by default
*/
- private $languagesWithIcuFolding = [];
+ private $languagesWithIcuFolding = [
+ 'el' => true,
+ 'en' => true,
+ 'en-ca' => true,
+ 'en-gb' => true,
+ 'simple' => true,
+ 'fr' => true,
+ ];
/**
* @var bool[] indexed by language code, languages where ICU
tokenization
diff --git a/tests/unit/Maintenance/AnalysisConfigBuilderTest.php
b/tests/unit/Maintenance/AnalysisConfigBuilderTest.php
index f464a45..b982dbd 100644
--- a/tests/unit/Maintenance/AnalysisConfigBuilderTest.php
+++ b/tests/unit/Maintenance/AnalysisConfigBuilderTest.php
@@ -30,6 +30,13 @@
public function testICUFolding( array $input, array $expected ) {
$config = new HashSearchConfig( ['CirrusSearchUseIcuFolding' =>
'yes' ] );
$plugins = ['extra', 'analysis-icu'];
+ $builder = new AnalysisConfigBuilder( 'unknown_language',
$plugins, $config );
+ $result = $builder->enableICUFolding( $input );
+ $this->assertEquals( $expected['analyzer'], $result['analyzer']
);
+
+ // Test default
+ $config = new HashSearchConfig( ['CirrusSearchUseIcuFolding' =>
'default' ] );
+ $plugins = ['extra', 'analysis-icu'];
$builder = new AnalysisConfigBuilder( 'en', $plugins, $config );
$result = $builder->enableICUFolding( $input );
$this->assertEquals( $expected['analyzer'], $result['analyzer']
);
--
To view, visit https://gerrit.wikimedia.org/r/313838
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2670d4130db351fc6b8f7c84172a8c9c6d07a181
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <[email protected]>
Gerrit-Reviewer: Cindy-the-browser-test-bot <[email protected]>
Gerrit-Reviewer: DCausse <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: Tjones <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits