EBernhardson has uploaded a new change for review.

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

Change subject: Initial relforge profiles for zh, th and ja
......................................................................

Initial relforge profiles for zh, th and ja

Change-Id: I14a6c2ef36549d43b175c5ecc0a0d75f4ae83630
---
M tests/relforge/bm25enwiki_inclinks/misc.inc
M tests/relforge/bm25enwiki_inclinks/similarity.inc
A tests/relforge/bm25jawiki_inclinks/ftbuilder.inc
A tests/relforge/bm25jawiki_inclinks/misc.inc
A tests/relforge/bm25jawiki_inclinks/rescore.inc
A tests/relforge/bm25jawiki_inclinks/similarity.inc
A tests/relforge/bm25jawiki_inclinks/templates.inc
A tests/relforge/bm25thwiki_inclinks/ftbuilder.inc
A tests/relforge/bm25thwiki_inclinks/misc.inc
A tests/relforge/bm25thwiki_inclinks/rescore.inc
A tests/relforge/bm25thwiki_inclinks/similarity.inc
A tests/relforge/bm25thwiki_inclinks/templates.inc
A tests/relforge/bm25zhwiki_inclinks/ftbuilder.inc
A tests/relforge/bm25zhwiki_inclinks/misc.inc
A tests/relforge/bm25zhwiki_inclinks/rescore.inc
A tests/relforge/bm25zhwiki_inclinks/similarity.inc
A tests/relforge/bm25zhwiki_inclinks/templates.inc
17 files changed, 672 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/13/316413/1

diff --git a/tests/relforge/bm25enwiki_inclinks/misc.inc 
b/tests/relforge/bm25enwiki_inclinks/misc.inc
index 3cfded1..0152be1 100644
--- a/tests/relforge/bm25enwiki_inclinks/misc.inc
+++ b/tests/relforge/bm25enwiki_inclinks/misc.inc
@@ -4,4 +4,3 @@
 $wgLanguagecode = 'en';
 $wgCirrusSearchIndexBaseName = 'enwikibm25perfield';
 $wgCirrusSearchPhraseSuggestReverseField['use'] = false;
-
diff --git a/tests/relforge/bm25enwiki_inclinks/similarity.inc 
b/tests/relforge/bm25enwiki_inclinks/similarity.inc
index c17eee1..93d2108 100644
--- a/tests/relforge/bm25enwiki_inclinks/similarity.inc
+++ b/tests/relforge/bm25enwiki_inclinks/similarity.inc
@@ -108,4 +108,3 @@
                'suggest' => 'suggest',
        ),
 );
-
diff --git a/tests/relforge/bm25jawiki_inclinks/ftbuilder.inc 
b/tests/relforge/bm25jawiki_inclinks/ftbuilder.inc
new file mode 100644
index 0000000..6f5c159
--- /dev/null
+++ b/tests/relforge/bm25jawiki_inclinks/ftbuilder.inc
@@ -0,0 +1,39 @@
+<?php
+
+$wgCirrusSearchFullTextQueryBuilderProfiles['relforge'] = array(
+       'builder_class' => 
\CirrusSearch\Query\FullTextSimpleMatchQueryBuilder::class,
+       'settings' => array(
+               'default_min_should_match' => '1',
+               'default_query_type' => 'most_fields',
+               'default_stem_weight' => 3.0,
+               'fields' => array(
+                       'title' => 0.3,
+                       'redirect.title' => array(
+                               'boost' => 0.27,
+                               'in_dismax' => 'redirects_or_shingles'
+                       ),
+                       'suggest' => array(
+                               'is_plain' => true,
+                               'boost' => 0.20,
+                               'in_dismax' => 'redirects_or_shingles',
+                       ),
+                       'category' => 0.05,
+                       'heading' => 0.05,
+                       'text' => array(
+                               'boost' => 0.6,
+                               'in_dismax' => 'text_and_opening_text',
+                       ),
+                       'opening_text' => array(
+                               'boost' => 0.5,
+                               'in_dismax' => 'text_and_opening_text',
+                       ),
+                       'auxiliary_text' => 0.05,
+                       'file_text' => 0.5,
+               ),
+               'phrase_rescore_fields' => array(
+                       // very low (don't forget it's multiplied by 10 by 
default)
+                       'all' => 0.03,
+                       'all.plain' => 0.05,
+               ),
+       )
+);
diff --git a/tests/relforge/bm25jawiki_inclinks/misc.inc 
b/tests/relforge/bm25jawiki_inclinks/misc.inc
new file mode 100644
index 0000000..135c948
--- /dev/null
+++ b/tests/relforge/bm25jawiki_inclinks/misc.inc
@@ -0,0 +1,6 @@
+<?php
+// 7 shards for enwiki
+$wgCirrusSearchShardCount = array( 'content' => 6, 'general' => 7, 
'titlesuggest' => 4 );
+$wgLanguagecode = 'ja';
+$wgCirrusSearchIndexBaseName = 'enwikibm25perfield';
+$wgCirrusSearchPhraseSuggestReverseField['use'] = false;
diff --git a/tests/relforge/bm25jawiki_inclinks/rescore.inc 
b/tests/relforge/bm25jawiki_inclinks/rescore.inc
new file mode 100644
index 0000000..9ee410b
--- /dev/null
+++ b/tests/relforge/bm25jawiki_inclinks/rescore.inc
@@ -0,0 +1,56 @@
+<?php
+
+// w sum with inc links alone (fallback with non content ns)
+$wgCirrusSearchIncLinksAloneW = 6.5;
+$wgCirrusSearchIncLinksAloneK = 30;
+$wgCirrusSearchIncLinksAloneA = 0.7;
+
+$wgCirrusSearchRescoreProfiles['relforge'] = array(
+       'supported_namespaces' => 'all',
+       'rescore' => array(
+               array(
+                       'window' => 8192,
+                       'window_size_override' => 
'CirrusSearchFunctionRescoreWindowSize',
+                       'query_weight' => 1.0,
+                       'rescore_query_weight' => 1.0,
+                       'score_mode' => 'total',
+                       'type' => 'function_score',
+                       'function_chain' => 'wsum_inclinks'
+               ),
+               array(
+                       'window' => 8192,
+                       'window_size_override' => 
'CirrusSearchFunctionRescoreWindowSize',
+                       'query_weight' => 1.0,
+                       'rescore_query_weight' => 1.0,
+                       'score_mode' => 'multiply',
+                       'type' => 'function_score',
+                       'function_chain' => 'optional_chain'
+               ),
+       ),
+);
+
+$wgCirrusSearchRescoreFunctionScoreChains['wsum_inclinks'] = array(
+       'functions' => array(
+               array(
+                       'type' => 'satu',
+                       'weight' => array(
+                               'value' => 1.2,
+                               'config_override' => 
'CirrusSearchIncLinksAloneW',
+                               'uri_param_override' => 'cirrusIncLinksAloneW',
+                       ),
+                       'params' => array(
+                               'field' => 'incoming_links',
+                               'k' => array(
+                                       'value' => 10,
+                                       'config_override' => 
'CirrusSearchIncLinksAloneK',
+                                       'uri_param_override' => 
'cirrusIncLinksAloneK',
+                               ),
+                               'a' => array(
+                                       'value' => 1,
+                                       'config_override' => 
'CirrusSearchIncLinksAloneA',
+                                       'uri_param_override' => 
'cirrusIncLinksAloneA',
+                               ),
+                       ),
+               ),
+       ),
+);
diff --git a/tests/relforge/bm25jawiki_inclinks/similarity.inc 
b/tests/relforge/bm25jawiki_inclinks/similarity.inc
new file mode 100644
index 0000000..93d2108
--- /dev/null
+++ b/tests/relforge/bm25jawiki_inclinks/similarity.inc
@@ -0,0 +1,110 @@
+<?php
+
+$wgCirrusSearchSimilarityProfiles['relforge'] = array(
+       'similarity' => array(
+               'title' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'title_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'opening_text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'opening_text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'auxiliary_text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'auxiliary_text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'category' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'category_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'redirect' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'redirect_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'heading' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'heading_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'suggest' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'all' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'all_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+       ),
+       'fields' => array(
+               '__default__' => 'text',
+               // Field specific config
+               'opening_text' => 'opening_text',
+               'opening_text.plain' => 'opening_text_plain',
+               'category' => 'category',
+               'category.plain' => 'category_plain',
+               'title' => 'title',
+               'title.plain' => 'title_plain',
+               'redirect' => 'redirect',
+               'redirect.plain' => 'redirect_plain',
+               'text' => 'text',
+               'text.plain' => 'text_plain',
+               'all' => 'all',
+               'all.plain' => 'all_plain',
+               'heading' => 'heading',
+               'heading.plain' => 'heading_plain',
+               'suggest' => 'suggest',
+       ),
+);
diff --git a/tests/relforge/bm25jawiki_inclinks/templates.inc 
b/tests/relforge/bm25jawiki_inclinks/templates.inc
new file mode 100644
index 0000000..abeae11
--- /dev/null
+++ b/tests/relforge/bm25jawiki_inclinks/templates.inc
@@ -0,0 +1,13 @@
+<?php
+
+$wgCirrusSearchBoostTemplates = [
+/*
+These templates does not seem to bring better scores with discernatron data...
+       'Template:Featured article' => 1,//1.25,
+       'Template:Featured picture' => 1,//1.25,
+       'Template:Featured_sound' => 1,//1.25,
+       'Template:Featured_list' => 1,//1.15,
+       'Template:Good_article' => 1,//1.1,
+*/
+];
+$wgCirrusSearchIgnoreOnWikiBoostTemplates = true;
diff --git a/tests/relforge/bm25thwiki_inclinks/ftbuilder.inc 
b/tests/relforge/bm25thwiki_inclinks/ftbuilder.inc
new file mode 100644
index 0000000..6f5c159
--- /dev/null
+++ b/tests/relforge/bm25thwiki_inclinks/ftbuilder.inc
@@ -0,0 +1,39 @@
+<?php
+
+$wgCirrusSearchFullTextQueryBuilderProfiles['relforge'] = array(
+       'builder_class' => 
\CirrusSearch\Query\FullTextSimpleMatchQueryBuilder::class,
+       'settings' => array(
+               'default_min_should_match' => '1',
+               'default_query_type' => 'most_fields',
+               'default_stem_weight' => 3.0,
+               'fields' => array(
+                       'title' => 0.3,
+                       'redirect.title' => array(
+                               'boost' => 0.27,
+                               'in_dismax' => 'redirects_or_shingles'
+                       ),
+                       'suggest' => array(
+                               'is_plain' => true,
+                               'boost' => 0.20,
+                               'in_dismax' => 'redirects_or_shingles',
+                       ),
+                       'category' => 0.05,
+                       'heading' => 0.05,
+                       'text' => array(
+                               'boost' => 0.6,
+                               'in_dismax' => 'text_and_opening_text',
+                       ),
+                       'opening_text' => array(
+                               'boost' => 0.5,
+                               'in_dismax' => 'text_and_opening_text',
+                       ),
+                       'auxiliary_text' => 0.05,
+                       'file_text' => 0.5,
+               ),
+               'phrase_rescore_fields' => array(
+                       // very low (don't forget it's multiplied by 10 by 
default)
+                       'all' => 0.03,
+                       'all.plain' => 0.05,
+               ),
+       )
+);
diff --git a/tests/relforge/bm25thwiki_inclinks/misc.inc 
b/tests/relforge/bm25thwiki_inclinks/misc.inc
new file mode 100644
index 0000000..fddb701
--- /dev/null
+++ b/tests/relforge/bm25thwiki_inclinks/misc.inc
@@ -0,0 +1,6 @@
+<?php
+// 7 shards for enwiki
+$wgCirrusSearchShardCount = array( 'content' => 2, 'general' => 1, 
'titlesuggest' => 4 );
+$wgLanguagecode = 'th';
+$wgCirrusSearchIndexBaseName = 'enwikibm25perfield';
+$wgCirrusSearchPhraseSuggestReverseField['use'] = false;
diff --git a/tests/relforge/bm25thwiki_inclinks/rescore.inc 
b/tests/relforge/bm25thwiki_inclinks/rescore.inc
new file mode 100644
index 0000000..9ee410b
--- /dev/null
+++ b/tests/relforge/bm25thwiki_inclinks/rescore.inc
@@ -0,0 +1,56 @@
+<?php
+
+// w sum with inc links alone (fallback with non content ns)
+$wgCirrusSearchIncLinksAloneW = 6.5;
+$wgCirrusSearchIncLinksAloneK = 30;
+$wgCirrusSearchIncLinksAloneA = 0.7;
+
+$wgCirrusSearchRescoreProfiles['relforge'] = array(
+       'supported_namespaces' => 'all',
+       'rescore' => array(
+               array(
+                       'window' => 8192,
+                       'window_size_override' => 
'CirrusSearchFunctionRescoreWindowSize',
+                       'query_weight' => 1.0,
+                       'rescore_query_weight' => 1.0,
+                       'score_mode' => 'total',
+                       'type' => 'function_score',
+                       'function_chain' => 'wsum_inclinks'
+               ),
+               array(
+                       'window' => 8192,
+                       'window_size_override' => 
'CirrusSearchFunctionRescoreWindowSize',
+                       'query_weight' => 1.0,
+                       'rescore_query_weight' => 1.0,
+                       'score_mode' => 'multiply',
+                       'type' => 'function_score',
+                       'function_chain' => 'optional_chain'
+               ),
+       ),
+);
+
+$wgCirrusSearchRescoreFunctionScoreChains['wsum_inclinks'] = array(
+       'functions' => array(
+               array(
+                       'type' => 'satu',
+                       'weight' => array(
+                               'value' => 1.2,
+                               'config_override' => 
'CirrusSearchIncLinksAloneW',
+                               'uri_param_override' => 'cirrusIncLinksAloneW',
+                       ),
+                       'params' => array(
+                               'field' => 'incoming_links',
+                               'k' => array(
+                                       'value' => 10,
+                                       'config_override' => 
'CirrusSearchIncLinksAloneK',
+                                       'uri_param_override' => 
'cirrusIncLinksAloneK',
+                               ),
+                               'a' => array(
+                                       'value' => 1,
+                                       'config_override' => 
'CirrusSearchIncLinksAloneA',
+                                       'uri_param_override' => 
'cirrusIncLinksAloneA',
+                               ),
+                       ),
+               ),
+       ),
+);
diff --git a/tests/relforge/bm25thwiki_inclinks/similarity.inc 
b/tests/relforge/bm25thwiki_inclinks/similarity.inc
new file mode 100644
index 0000000..93d2108
--- /dev/null
+++ b/tests/relforge/bm25thwiki_inclinks/similarity.inc
@@ -0,0 +1,110 @@
+<?php
+
+$wgCirrusSearchSimilarityProfiles['relforge'] = array(
+       'similarity' => array(
+               'title' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'title_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'opening_text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'opening_text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'auxiliary_text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'auxiliary_text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'category' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'category_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'redirect' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'redirect_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'heading' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'heading_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'suggest' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'all' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'all_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+       ),
+       'fields' => array(
+               '__default__' => 'text',
+               // Field specific config
+               'opening_text' => 'opening_text',
+               'opening_text.plain' => 'opening_text_plain',
+               'category' => 'category',
+               'category.plain' => 'category_plain',
+               'title' => 'title',
+               'title.plain' => 'title_plain',
+               'redirect' => 'redirect',
+               'redirect.plain' => 'redirect_plain',
+               'text' => 'text',
+               'text.plain' => 'text_plain',
+               'all' => 'all',
+               'all.plain' => 'all_plain',
+               'heading' => 'heading',
+               'heading.plain' => 'heading_plain',
+               'suggest' => 'suggest',
+       ),
+);
diff --git a/tests/relforge/bm25thwiki_inclinks/templates.inc 
b/tests/relforge/bm25thwiki_inclinks/templates.inc
new file mode 100644
index 0000000..abeae11
--- /dev/null
+++ b/tests/relforge/bm25thwiki_inclinks/templates.inc
@@ -0,0 +1,13 @@
+<?php
+
+$wgCirrusSearchBoostTemplates = [
+/*
+These templates does not seem to bring better scores with discernatron data...
+       'Template:Featured article' => 1,//1.25,
+       'Template:Featured picture' => 1,//1.25,
+       'Template:Featured_sound' => 1,//1.25,
+       'Template:Featured_list' => 1,//1.15,
+       'Template:Good_article' => 1,//1.1,
+*/
+];
+$wgCirrusSearchIgnoreOnWikiBoostTemplates = true;
diff --git a/tests/relforge/bm25zhwiki_inclinks/ftbuilder.inc 
b/tests/relforge/bm25zhwiki_inclinks/ftbuilder.inc
new file mode 100644
index 0000000..6f5c159
--- /dev/null
+++ b/tests/relforge/bm25zhwiki_inclinks/ftbuilder.inc
@@ -0,0 +1,39 @@
+<?php
+
+$wgCirrusSearchFullTextQueryBuilderProfiles['relforge'] = array(
+       'builder_class' => 
\CirrusSearch\Query\FullTextSimpleMatchQueryBuilder::class,
+       'settings' => array(
+               'default_min_should_match' => '1',
+               'default_query_type' => 'most_fields',
+               'default_stem_weight' => 3.0,
+               'fields' => array(
+                       'title' => 0.3,
+                       'redirect.title' => array(
+                               'boost' => 0.27,
+                               'in_dismax' => 'redirects_or_shingles'
+                       ),
+                       'suggest' => array(
+                               'is_plain' => true,
+                               'boost' => 0.20,
+                               'in_dismax' => 'redirects_or_shingles',
+                       ),
+                       'category' => 0.05,
+                       'heading' => 0.05,
+                       'text' => array(
+                               'boost' => 0.6,
+                               'in_dismax' => 'text_and_opening_text',
+                       ),
+                       'opening_text' => array(
+                               'boost' => 0.5,
+                               'in_dismax' => 'text_and_opening_text',
+                       ),
+                       'auxiliary_text' => 0.05,
+                       'file_text' => 0.5,
+               ),
+               'phrase_rescore_fields' => array(
+                       // very low (don't forget it's multiplied by 10 by 
default)
+                       'all' => 0.03,
+                       'all.plain' => 0.05,
+               ),
+       )
+);
diff --git a/tests/relforge/bm25zhwiki_inclinks/misc.inc 
b/tests/relforge/bm25zhwiki_inclinks/misc.inc
new file mode 100644
index 0000000..a4e62f9
--- /dev/null
+++ b/tests/relforge/bm25zhwiki_inclinks/misc.inc
@@ -0,0 +1,6 @@
+<?php
+// 7 shards for enwiki
+$wgCirrusSearchShardCount = array( 'content' => 7, 'general' => 5, 
'titlesuggest' => 4 );
+$wgLanguageCode = 'zh';
+$wgCirrusSearchIndexBaseName = 'zhwikibm25perfield';
+$wgCirrusSearchPhraseSuggestReverseField['use'] = false;
diff --git a/tests/relforge/bm25zhwiki_inclinks/rescore.inc 
b/tests/relforge/bm25zhwiki_inclinks/rescore.inc
new file mode 100644
index 0000000..9ee410b
--- /dev/null
+++ b/tests/relforge/bm25zhwiki_inclinks/rescore.inc
@@ -0,0 +1,56 @@
+<?php
+
+// w sum with inc links alone (fallback with non content ns)
+$wgCirrusSearchIncLinksAloneW = 6.5;
+$wgCirrusSearchIncLinksAloneK = 30;
+$wgCirrusSearchIncLinksAloneA = 0.7;
+
+$wgCirrusSearchRescoreProfiles['relforge'] = array(
+       'supported_namespaces' => 'all',
+       'rescore' => array(
+               array(
+                       'window' => 8192,
+                       'window_size_override' => 
'CirrusSearchFunctionRescoreWindowSize',
+                       'query_weight' => 1.0,
+                       'rescore_query_weight' => 1.0,
+                       'score_mode' => 'total',
+                       'type' => 'function_score',
+                       'function_chain' => 'wsum_inclinks'
+               ),
+               array(
+                       'window' => 8192,
+                       'window_size_override' => 
'CirrusSearchFunctionRescoreWindowSize',
+                       'query_weight' => 1.0,
+                       'rescore_query_weight' => 1.0,
+                       'score_mode' => 'multiply',
+                       'type' => 'function_score',
+                       'function_chain' => 'optional_chain'
+               ),
+       ),
+);
+
+$wgCirrusSearchRescoreFunctionScoreChains['wsum_inclinks'] = array(
+       'functions' => array(
+               array(
+                       'type' => 'satu',
+                       'weight' => array(
+                               'value' => 1.2,
+                               'config_override' => 
'CirrusSearchIncLinksAloneW',
+                               'uri_param_override' => 'cirrusIncLinksAloneW',
+                       ),
+                       'params' => array(
+                               'field' => 'incoming_links',
+                               'k' => array(
+                                       'value' => 10,
+                                       'config_override' => 
'CirrusSearchIncLinksAloneK',
+                                       'uri_param_override' => 
'cirrusIncLinksAloneK',
+                               ),
+                               'a' => array(
+                                       'value' => 1,
+                                       'config_override' => 
'CirrusSearchIncLinksAloneA',
+                                       'uri_param_override' => 
'cirrusIncLinksAloneA',
+                               ),
+                       ),
+               ),
+       ),
+);
diff --git a/tests/relforge/bm25zhwiki_inclinks/similarity.inc 
b/tests/relforge/bm25zhwiki_inclinks/similarity.inc
new file mode 100644
index 0000000..93d2108
--- /dev/null
+++ b/tests/relforge/bm25zhwiki_inclinks/similarity.inc
@@ -0,0 +1,110 @@
+<?php
+
+$wgCirrusSearchSimilarityProfiles['relforge'] = array(
+       'similarity' => array(
+               'title' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'title_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'opening_text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'opening_text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'auxiliary_text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'auxiliary_text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'category' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'category_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'redirect' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'redirect_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'heading' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'heading_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'suggest' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.3,
+               ),
+               'text' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'text_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'all' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+               'all_plain' => array(
+                       'type' => 'BM25',
+                       'k1' => 1.2,
+                       'b' => 0.75,
+               ),
+       ),
+       'fields' => array(
+               '__default__' => 'text',
+               // Field specific config
+               'opening_text' => 'opening_text',
+               'opening_text.plain' => 'opening_text_plain',
+               'category' => 'category',
+               'category.plain' => 'category_plain',
+               'title' => 'title',
+               'title.plain' => 'title_plain',
+               'redirect' => 'redirect',
+               'redirect.plain' => 'redirect_plain',
+               'text' => 'text',
+               'text.plain' => 'text_plain',
+               'all' => 'all',
+               'all.plain' => 'all_plain',
+               'heading' => 'heading',
+               'heading.plain' => 'heading_plain',
+               'suggest' => 'suggest',
+       ),
+);
diff --git a/tests/relforge/bm25zhwiki_inclinks/templates.inc 
b/tests/relforge/bm25zhwiki_inclinks/templates.inc
new file mode 100644
index 0000000..abeae11
--- /dev/null
+++ b/tests/relforge/bm25zhwiki_inclinks/templates.inc
@@ -0,0 +1,13 @@
+<?php
+
+$wgCirrusSearchBoostTemplates = [
+/*
+These templates does not seem to bring better scores with discernatron data...
+       'Template:Featured article' => 1,//1.25,
+       'Template:Featured picture' => 1,//1.25,
+       'Template:Featured_sound' => 1,//1.25,
+       'Template:Featured_list' => 1,//1.15,
+       'Template:Good_article' => 1,//1.1,
+*/
+];
+$wgCirrusSearchIgnoreOnWikiBoostTemplates = true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14a6c2ef36549d43b175c5ecc0a0d75f4ae83630
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>

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

Reply via email to