【发布时间】:2020-04-07 11:27:28
【问题描述】:
我在 Bing News API v7 integration 工作。更准确地说,我使用https://api.cognitive.microsoft.com/bing/v7.0/news/search API 端点。
我发现了一些“意外”的分页行为。 (预期的行为是每个页面都有恒定的大小)。
在此页面上解释了如何How to page through results。
我遵循这种方法。我使用 30 作为页面大小;因此,偏移量的值为 0、30、60 等。
例如,使用这些参数时:查询“Java 14”、市场“en-US”、按日期排序,偏移量的值为 0、30、60、90、120、150
(/bing/v7.0/news/search?q=Java 14&count=30&offset=0&mkt=en-US&sortBy=date)。
我得到六页结果,每页包含少于 30 个 URL。
Page: 0 Total: 27 results
Page: 1 Total: 26 results
Page: 2 Total: 26 results
Page: 3 Total: 29 results
Page: 4 Total: 29 results
Page: 5 Total: 7 results
...
此 * What's the expected behavior of the Bing Search API v5 when deeply paginating? 与 Bing API v5 相关。分页值不遵循固定大小的顺序,但公式为previous result size + 1。
所以,我的问题是:
我应该使用哪些值作为第二页的偏移量 (Page: 1)?是28还是30?第三页 (Page 2) 的值是 54 还是 60?
【问题讨论】:
标签: bing bing-api bing-news-search-api