【问题标题】:How to limit Bing Search API V5 to search specific sections of the website如何限制 Bing Search API V5 搜索网站的特定部分
【发布时间】:2018-01-18 04:57:28
【问题描述】:

使用 bing.com,我可以进行这样的搜索(点击 here 获取链接):

history site:berkeley.edu/about/

当我使用 API 尝试相同的操作时,我会得到非常不同的结果。据我所知,搜索结果返回的网页不在 berkeley.edu 中(见底部)。

这是向 Azure 发出的 HTTP GET 请求

https://api.cognitive.microsoft.com/bing/v5.0/search?q=history+site:berkeley.edu/about/&count=10&offset=0

这是我的 HTTP GET 代码

    $.ajax({
        url: "https://api.cognitive.microsoft.com/bing/v5.0/search"
        , data: { "q":encodeURI("history+site:berkeley.edu/about/"), "count":"10", "offset":"0" }
        , beforeSend: function(xhrObj){
            xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","supply-your-key-here");
        }
        , type: "GET",
    })

有什么想法我可能做错了吗?谢谢

edit1: 似乎我的“问题”与 AJAX 发出 HTTP 请求的方式有关。如果我使用 Firefox 标头插件提供我的密钥并在我的浏览器 URL 框中键入此 (https://api.cognitive.microsoft.com/bing/v5.0/search?q=history+site:berkeley.edu/about/&count=10&offset=0),我会得到正确的响应。

使用 API 搜索结果

    Environmental Design Library | UC Berkeley Library: A branch of the UC Berkeley Library system, the Environmental Design Library supports the research and teaching of the College of Environmental Design.

Proceedings Template - WORD - ideals.illinois.edu: "(c) ACM, 2007. This is the authors’ version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution.

Trends in metadata practices: A longitudinal study of ...: Trends in metadata practices: A longitudinal study of collection federation. ... A Longitudinal Study of Collection Federation Carole Palmer Oksana ...

http://aerospaceutility.tripod.com/ · GitHub: Clone via HTTPS Clone with Git or checkout with SVN using the repository's web address.

HS RWC Colorado Sample Instructional Units - LiveBinder: Loading Livebinder HS RWC Colorado Sample Instructional Units HS Read Write Communicate Sample Instructional Units provided by the Colorado Department of Education.

Arroyo High School: News Archive: News Archive SIA Awards "As the school year comes to a close, the Students in Action club would like to honor three students for their lasting impact on our ...

English 12 (exp) | Utah Electronic High School: Please be mindful of the fact that this course is not a credit "quick fix." It is a rigorous, college-preparatory class that is both time and labor intensive.

Working SMARTer, not Harder: SOCIAL STUDIES ONLINE ...: SOCIAL STUDIES ONLINE RESOURCES AND LINKS COMPILATION beta List of Social Studies online resources and links to professional development opportunities ...

The Big List -- 20121008 - Grolier: The Big List -- 20121008: 1: EA: http://www.stanford.edu/group/bipolar.clinic/ Stanford Bipolar Disorders Clinic: 2: EA: http://www.mhsource.com/bipolar/

Spreadsheet of Conference Attendees - studylib.net: ÐÏ à¡± á > þÿ ] þÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ...

【问题讨论】:

    标签: bing bing-api bing-search azure-cognitive-services


    【解决方案1】:

    您可以交替使用 Bing 自定义搜索,以确保仅从所需的域/网页中获得结果。这是电话:https://api.cognitive.microsoft.com/bingcustomsearch/v7.0/search。不过,您将需要一个不同的访问密钥,您可以从 customsearch.ai 获得。

    【讨论】:

      【解决方案2】:

      我在 v5.0 和 v7.0 上都得到了正确的结果。 您的查询似乎没有问题。

      https://api.cognitive.microsoft.com/bing/v5.0/search?q=history+site:berkeley.edu/about/&count=10&offset=0
      

      也许您正在浏览器的某处缓存结果?

      更新:因为 IE 会这样做,但 Firefox 不会。您是否在 IE 上禁用了缓存?

      【讨论】:

        猜你喜欢
        • 2023-03-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-22
        • 1970-01-01
        相关资源
        最近更新 更多