简单的 Bing 新闻搜索 Api - 搜索短语
我想搜索一个短语而不是单词集合 我该怎么做?
例如 "&Query= Widget Foo"
我只想返回包含短语“Widget Foo”的结果,而不是与 foo 分开的小部件。
I want to search for a phrase and not the collection of words How can I do this?
For instance
"&Query= Widget Foo"
I only want to return results with the phrase 'Widget Foo' and not widget separate from foo.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将您的搜索词用引号引起来。这是一个已经进行 url 编码的示例:
Wrap your search term in quotes. Here is an example that is already url encoded:
同样的原则也适用于使用 Bing API 订阅模型搜索的短语:
https://datamarket.azure。 com/dataset/bing/search
因此,如果您正在查找新闻短语:
“佩林在 CPAC 演讲中嘲笑奥巴马和罗夫”
..将您的查询括在引号中,并对引号进行 URL 编码:
https://api.datamarket.azure.com/Bing/Search/v1/News?Query=%27%22Palin%20mocks%20Obama%20and%20Rove%20in%20CPAC%20speech%22%27
Same principle applies to phrases searched for with the Bing API's subscription model at:
https://datamarket.azure.com/dataset/bing/search
So if you're looking for the news phrase:
"Palin mocks Obama and Rove in CPAC speech"
..wrap your query in quotes and URL encode the quotes as well:
https://api.datamarket.azure.com/Bing/Search/v1/News?Query=%27%22Palin%20mocks%20Obama%20and%20Rove%20in%20CPAC%20speech%22%27