[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Simple hack to override mlr model from query string

2017-12-07 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/395826 )

Change subject: Simple hack to override mlr model from query string
..


Simple hack to override mlr model from query string

This is a rather naive attempt to allow us to do a sanity
check on an MLR model before we roll it out. With the new
cirrusMLRModel query parameter we can upload a model to
elasticsearch and try a couple queries by specifying the
model name before we ship a config cange to enable the
model for everyone.

Change-Id: Id258c4ad295eab8cac543f14e9135a1bdb87533a
---
M includes/Search/RescoreBuilders.php
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  DCausse: Looks good to me, approved



diff --git a/includes/Search/RescoreBuilders.php 
b/includes/Search/RescoreBuilders.php
index 76a4fac..3119a01 100644
--- a/includes/Search/RescoreBuilders.php
+++ b/includes/Search/RescoreBuilders.php
@@ -127,6 +127,17 @@
 * @return AbstractQuery
 */
private function buildLtrQuery( $model ) {
+   // This is a bit fragile, and makes the bold assumption
+   // only a single level of rescore will be used. This is
+   // strictly for debugging/testing before shipping a model
+   // live so shouldn't be a big deal.
+   $override = \RequestContext::getMain()
+   ->getRequest()
+   ->getVal( 'cirrusMLRModel' );
+   if ( $override ) {
+   $model = $override;
+   }
+
$bool = new \Elastica\Query\BoolQuery();
// the ltr query can return negative scores, which mucks with 
elasticsearch
// sorting as that will put these results below documents set 
to 0. Fix

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id258c4ad295eab8cac543f14e9135a1bdb87533a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: Tjones 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Simple hack to override mlr model from query string

2017-12-06 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395826 )

Change subject: Simple hack to override mlr model from query string
..

Simple hack to override mlr model from query string

This is a rather naive attempt to allow us to do a sanity
check on an MLR model before we roll it out. With the new
cirrusMLRModel query parameter we can upload a model to
elasticsearch and try a couple queries by specifying the
model name before we ship a config cange to enable the
model for everyone.

Change-Id: Id258c4ad295eab8cac543f14e9135a1bdb87533a
---
M includes/Search/RescoreBuilders.php
1 file changed, 11 insertions(+), 0 deletions(-)


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

diff --git a/includes/Search/RescoreBuilders.php 
b/includes/Search/RescoreBuilders.php
index 76a4fac..3119a01 100644
--- a/includes/Search/RescoreBuilders.php
+++ b/includes/Search/RescoreBuilders.php
@@ -127,6 +127,17 @@
 * @return AbstractQuery
 */
private function buildLtrQuery( $model ) {
+   // This is a bit fragile, and makes the bold assumption
+   // only a single level of rescore will be used. This is
+   // strictly for debugging/testing before shipping a model
+   // live so shouldn't be a big deal.
+   $override = \RequestContext::getMain()
+   ->getRequest()
+   ->getVal( 'cirrusMLRModel' );
+   if ( $override ) {
+   $model = $override;
+   }
+
$bool = new \Elastica\Query\BoolQuery();
// the ltr query can return negative scores, which mucks with 
elasticsearch
// sorting as that will put these results below documents set 
to 0. Fix

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id258c4ad295eab8cac543f14e9135a1bdb87533a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

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