goferito / node-bing-api

Node.js module for the Bing Search API (Cognitive Services)
MIT License
56 stars 28 forks source link

Suggestions API #38

Open PhilHannent opened 7 years ago

PhilHannent commented 7 years ago

Good morning,

Firstly, thanks for the project.

I have tripped over a problem recently where the API doesn't return me what I was expecting. Whilst I know the solution to my problem I am not 100% sure how it best fits with this project.

I have been using the relatedSearch for related key words.

https://github.com/goferito/node-bing-api/blob/master/lib/bing.js#L270

However what I am actually after is the 'suggestions' API:

https://docs.microsoft.com/en-us/azure/cognitive-services/Bing-Autosuggest/get-suggested-search-terms

My fix was to make the related be suggestions, because as it stands it seems to actually just perform the same as web. Should your related call use 'suggestions' or should there be a separate call for suggestions?

Thanks