Convenience library for making searches for titles that match a string.
Loaded via the mediawiki.searchSuggest
ResourceLoader library.
Example
mw.loader.using('mediawiki.searchSuggest').then(() => {
var api = new mw.Api();
mw.searchSuggest.request(api, 'Dogs that', ( results ) => {
alert( `Results that match: ${results.join( '\n' );}` );
});
});
Methods
request(api, query, response, [limit], [namespace]) → {jQuery.Deferred}static
#
Queries the wiki and calls response with the result.
Type Definitions
ResponseFunction(titles, meta)
#
Parameters:
Name | Type | Description |
---|---|---|
titles |
Array.<string> | titles of pages that match search |
meta |
ResponseMetaData | meta data relating to search. |