jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Run AB test with phrase boost of 1"
......................................................................
Revert "Run AB test with phrase boost of 1"
The test has completed and we can now turn this back off.
This reverts commit bbb3d1055d3fa743857c7ee38af57404be7d7ce5.
Bug: T129607
Change-Id: Ic68414e9236283f7421e0d9bf28c1dc9303be066
(cherry picked from commit 0479cc75c1fe6d0352ad8787b540ac22485d48a5)
---
M modules/ext.wikimediaEvents.searchSatisfaction.js
1 file changed, 22 insertions(+), 52 deletions(-)
Approvals:
MaxSem: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ext.wikimediaEvents.searchSatisfaction.js
b/modules/ext.wikimediaEvents.searchSatisfaction.js
index 28fb7c7..7d7484f 100644
--- a/modules/ext.wikimediaEvents.searchSatisfaction.js
+++ b/modules/ext.wikimediaEvents.searchSatisfaction.js
@@ -25,7 +25,7 @@
return;
}
- var search, autoComplete, session, eventLog, initSubTest,
+ var search, autoComplete, session, eventLog,
isSearchResultPage = mw.config.get( 'wgIsSearchResultPage' ),
uri = new mw.Uri( location.href ),
checkinTimes = [ 10, 20, 30, 40, 50, 60, 90, 120, 150, 180,
210, 240, 300, 360, 420 ],
@@ -67,7 +67,6 @@
// persistent state keys that have a lifetime
ttl = {
sessionId: 10 * 60 * 1000,
- subTest: 10 * 60 * 1000,
token: 24 * 60 * 60 * 1000
},
now = new Date().getTime();
@@ -121,7 +120,7 @@
}
// If a sessionId exists the user was previously
accepted into the test
if ( !sessionId ) {
- if ( !oneIn( 100 ) ) {
+ if ( !oneIn( 200 ) ) {
// user was not chosen in a sampling of
search results
session.set( 'sessionId', 'rejected' );
return false;
@@ -130,11 +129,6 @@
// have a search session id, generate one.
if ( !session.set( 'sessionId', randomToken() )
) {
return false;
- }
-
- // Assign 50% of users to test bucket
- if ( oneIn( 2 ) ) {
- session.set( 'subTest',
'phraseBoostEq1' );
}
}
@@ -365,10 +359,6 @@
lastScrollTop = scrollTop;
- if ( session.get( 'subTest' ) ) {
- evt.subTest = session.get( 'subTest' );
- }
-
if ( articleId > 0 ) {
evt.articleId = articleId;
}
@@ -479,32 +469,6 @@
}
/**
- * Decorator to call the inner function at most one time.
- *
- * @param {Function} fn
- * @return {Function}
- */
- function atMostOnce( fn ) {
- var called = false;
- return function () {
- if ( !called ) {
- fn.apply( null, arguments );
- called = true;
- }
- };
- }
-
- initSubTest = atMostOnce( function ( session ) {
- if ( session.get( 'subTest' ) === 'phraseBoostEq1' ) {
- $( '<input>' ).attr( {
- type: 'hidden',
- name: 'cirrusPhraseBoost',
- value: '1'
- } ).insertAfter( $( 'input[type=search]' ) );
- }
- } );
-
- /**
* Delay session initialization as late in the
* process as possible, but only do it once.
*
@@ -515,8 +479,23 @@
if ( session.get( 'enabled' ) ) {
fn( session );
- initSubTest( session );
}
+ }
+
+ /**
+ * Decorator to call the inner function at most one time.
+ *
+ * @param {Function} fn
+ * @return {Function}
+ */
+ function atMostOnce( fn ) {
+ var called = false;
+ return function () {
+ if ( !called ) {
+ fn();
+ called = true;
+ }
+ };
}
// Full text search satisfaction tracking
@@ -528,28 +507,19 @@
// Autocomplete satisfaction tracking
$( document ).ready( function () {
- var initialize = atMostOnce( function () {
- setup( setupAutocompleteTest );
- } );
if ( autoComplete.cameFromSearch ) {
// user came here by selecting an autocomplete result,
// initialize on page load
- initialize();
+ setup( setupAutocompleteTest );
} else {
// delay initialization until the user clicks into the
autocomplete
// box. Note there are two elements matching this
selector, the
// main search box on Special:Search and the search box
on every
// page. $.one fires once per element and not once
ever, hence the
// decorator.
- //
- // This has to subscribe to multiple events to ensure
it captures
- // in modern browsers (input) and less modern browsers
(the rest).
- // The atMostOne() makes sure we only truly initialize
once.
- $( 'input[type=search]' )
- .one( 'input', initialize )
- .one( 'change', initialize )
- .one( 'paste', initialize )
- .one( 'keypress', initialize );
+ $( 'input[type=search]' ).one( 'focus', atMostOnce(
function () {
+ setup( setupAutocompleteTest );
+ } ) );
}
} );
--
To view, visit https://gerrit.wikimedia.org/r/279073
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic68414e9236283f7421e0d9bf28c1dc9303be066
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: wmf/1.27.0-wmf.17
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits