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 <ebernhard...@wikimedia.org>

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

Reply via email to