DCausse has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/397855 )
Change subject: [cirrus] tune wikidata similarity configuration
......................................................................
[cirrus] tune wikidata similarity configuration
Bug: T182293
Depends-On: I4e79bf1a389beec423b07e34082c4b8920e54af0
Change-Id: I8fd10cead1116363c1e3a2f4be48916498109639
---
M wmf-config/InitialiseSettings.php
M wmf-config/Wikibase.php
2 files changed, 38 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/55/397855/1
diff --git a/wmf-config/InitialiseSettings.php
b/wmf-config/InitialiseSettings.php
index 934235c..0b74818 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -18291,6 +18291,9 @@
"jv" => "default",
"zh-min-nan" => "default", // needs to support deprecated language code
(e.g. zh_min_nanwikisource)
"nan" => "default", // e.g. zh_min_nan
+ // Currently defined in Wikibase.php
+ "wikidata" => "wikibase_similarity",
+ "testwikidata" => "wikibase_similarity",
],
'wmgCirrusSearchRescoreProfile' => [
diff --git a/wmf-config/Wikibase.php b/wmf-config/Wikibase.php
index f4e8b3a..9ebd8ee 100644
--- a/wmf-config/Wikibase.php
+++ b/wmf-config/Wikibase.php
@@ -207,6 +207,41 @@
'uk' => [ 'index' => true, 'query' => true ],
'zh' => [ 'index' => true, 'query' => true ],
];
+
+ if ( is_array( $wgCirrusSearchSimilarityProfiles ) ) {
+ // TODO: have proper profile management in cirrus
+ $wgCirrusSearchSimilarityProfiles['wikibase_similarity'] = [
+ 'similarity' => [
+ 'default' => [
+ 'type' => 'BM25',
+ ],
+ 'descriptions' => [
+ 'type' => 'BM25',
+ ],
+ // This is a bit verbose to redefine always the
same settings
+ // but the advantage is that you can re-tune
and specialize
+ // these on an existing index (requires closing
the index).
+ // "labels" here means the label + aliases
+ 'labels' => [
+ 'type' => 'BM25',
+ 'k1' => 1.2,
+ 'b' => 0.3,
+ ],
+ // We consider all as being very similar to an
array field
+ // as it is a simple concatenation of all the
item data
+ 'all' => [
+ 'type' => 'BM25',
+ 'k1' => 1.2,
+ 'b' => 0.3,
+ ]
+ ],
+ 'fields' => [
+ '__default__' => 'default',
+ 'labels' => 'labels',
+ 'descriptions' => 'descriptions',
+ 'all' => 'all',
+ ]
+ ];
}
if ( $wmgUseWikibaseClient ) {
--
To view, visit https://gerrit.wikimedia.org/r/397855
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fd10cead1116363c1e3a2f4be48916498109639
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: DCausse <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits