Support for related search and spelling suggestions

This commit is contained in:
goferito 2015-11-06 20:41:19 +01:00
parent f3909e5c0f
commit 8d3d53c261
3 changed files with 96 additions and 0 deletions

View file

@ -258,6 +258,43 @@ Bing.prototype.images = function (query, options, callback) {
};
/**
* Performs a Bing search in the Related Search vertical.
*
* @param {String} query Query term to search for.
*
* @param {Object} options Options to command, allows overriding
* of rootUri, accKey (Bing API key),
* userAgent, reqTimeout, top, skip,
*
* @param {requestCallback} callback Callback called with (potentially
* json-parsed) response.
* @function
*/
Bing.prototype.relatedSearch = function (query, options, callback) {
this.searchVertical(query, "RelatedSearch", options, callback);
};
/**
* Performs a Bing search in the Spelling Suggestions vertical.
*
* @param {String} query Query term to search for.
*
* @param {Object} options Options to command, allows overriding
* of rootUri, accKey (Bing API key),
* userAgent, reqTimeout, top, skip,
*
* @param {requestCallback} callback Callback called with (potentially
* json-parsed) response.
* @function
*/
Bing.prototype.spelling = function (query, options, callback) {
this.searchVertical(query, "SpellingSuggestions", options, callback);
};
/**
* Capitalises the first word of the passed string
*