From: Erik Bernhardson Date: Fri, 18 Dec 2015 21:21:53 +0000 (-0800) Subject: Allow overriding the resultSetType reported via event logging of suggestions X-Git-Tag: 1.31.0-rc.0~8624^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=722ac2f8ff67a4fe11e4fd3e6c5f23cee80ce0dd;p=lhc%2Fweb%2Fwiklou.git Allow overriding the resultSetType reported via event logging of suggestions Change-Id: I0c1b19019f11b719a6d728d6a46881cc83ca2430 --- diff --git a/resources/src/mediawiki/mediawiki.searchSuggest.js b/resources/src/mediawiki/mediawiki.searchSuggest.js index c960d6570e..ada4924815 100644 --- a/resources/src/mediawiki/mediawiki.searchSuggest.js +++ b/resources/src/mediawiki/mediawiki.searchSuggest.js @@ -3,6 +3,7 @@ */ ( function ( mw, $ ) { mw.searchSuggest = { + // queries the wiki and calls response with the result request: function ( api, query, response, maxRows ) { return api.get( { action: 'opensearch', @@ -13,7 +14,9 @@ } ).done( function ( data ) { response( data[ 1 ] ); } ); - } + }, + // The name of the request api for event logging purposes + type: 'prefix' }; $( function () { @@ -98,9 +101,7 @@ mw.track( 'mediawiki.searchSuggest', { action: 'impression-results', numberOfResults: context.config.suggestions.length, - // FIXME: when other types of search become available change this value accordingly - // See the API call below (opensearch = prefix) - resultSetType: 'prefix' + resultSetType: mw.searchSuggest.type } ); }