EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/260133
Change subject: Allow overriding the resultSetType reported via event logging
of suggestions
......................................................................
Allow overriding the resultSetType reported via event logging of suggestions
Change-Id: I0c1b19019f11b719a6d728d6a46881cc83ca2430
(cherry picked from commit 722ac2f8ff67a4fe11e4fd3e6c5f23cee80ce0dd)
---
M resources/src/mediawiki/mediawiki.searchSuggest.js
1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/33/260133/1
diff --git a/resources/src/mediawiki/mediawiki.searchSuggest.js
b/resources/src/mediawiki/mediawiki.searchSuggest.js
index c960d65..ada4924 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
} );
}
--
To view, visit https://gerrit.wikimedia.org/r/260133
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c1b19019f11b719a6d728d6a46881cc83ca2430
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.9
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits