首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >搜索堆栈溢出和使用API给出了不同的结果?

搜索堆栈溢出和使用API给出了不同的结果?
EN

Stack Apps用户
提问于 2014-07-25 13:54:02
回答 1查看 2.8K关注 0票数 3

我正在尝试使用来查看不同主题的趋势。

看一下API文档,我发现我可以使用这个/search路径来完成这个任务(它记录了这个方法是有限的,尽管它没有提到结果限制的意义还是其他类型的限制)。

我还试过/advanced-search

没有提到这一项的任何限制。然而,我没有得到相同的结果,当我在网站上搜索。

例如:

代码语言:javascript
复制
/2.2/search/advanced?order=desc&sort=activity&q=raml rest&site=stackoverflow

(没有页码,没有限制,没有任何内容)产生:

代码语言:javascript
复制
{
  "items": [
    {
      "tags": [
        "rest",
        "azure",
        "code-generation"
      ],
      "owner": {
        "reputation": 16,
        "user_id": 1224349,
        "user_type": "registered",
        "profile_image": "https://www.gravatar.com/avatar/76aaf9ca0eb0910b440909a2faa1dd9a?s=128&d=identicon&r=PG",
        "display_name": "Paul Topping",
        "link": "https://stackoverflow.com/users/1224349/paul-topping"
      },
      "is_answered": true,
      "view_count": 24,
      "answer_count": 1,
      "score": 1,
      "last_activity_date": 1399090892,
      "creation_date": 1399052046,
      "question_id": 23433836,
      "link": "https://stackoverflow.com/questions/23433836/azure-generating-rest-sdks-from-idl",
      "title": "Azure - generating REST SDKs from IDL"
    },
    {
      "tags": [
        "angularjs",
        "rest",
        "raml"
      ],
      "owner": {
        "reputation": 1117,
        "user_id": 1339087,
        "user_type": "registered",
        "accept_rate": 80,
        "profile_image": "https://www.gravatar.com/avatar/7b72123a28e4d5567e9d5f7f2b9b56ee?s=128&d=identicon&r=PG",
        "display_name": "Nikos",
        "link": "https://stackoverflow.com/users/1339087/nikos"
      },
      "is_answered": true,
      "view_count": 98,
      "answer_count": 1,
      "score": 0,
      "last_activity_date": 1396016921,
      "creation_date": 1396016533,
      "question_id": 22715481,
      "link": "https://stackoverflow.com/questions/22715481/angular-js-integration-with-the-in-browser-raml-parser",
      "title": "Angular.js integration with the in-browser RAML parser"
    },
    {
      "tags": [
        "rest",
        "swagger",
        "apiblueprint",
        "raml"
      ],
      "owner": {
        "reputation": 803,
        "user_id": 557869,
        "user_type": "registered",
        "accept_rate": 79,
        "profile_image": "https://www.gravatar.com/avatar/dd75fa8d754b882a16dbddb5bb1cad9f?s=128&d=identicon&r=PG",
        "display_name": "DeBuGGeR",
        "link": "https://stackoverflow.com/users/557869/debugger"
      },
      "is_answered": true,
      "view_count": 993,
      "accepted_answer_id": 22563014,
      "answer_count": 2,
      "score": 2,
      "last_activity_date": 1395415971,
      "creation_date": 1395322866,
      "question_id": 22534792,
      "link": "https://stackoverflow.com/questions/22534792/good-rest-code-generation-and-documentation-tool",
      "title": "Good rest code generation and documentation tool"
    },
    {
      "tags": [
        "api",
        "rest",
        "oauth-2.0",
        "raml"
      ],
      "owner": {
        "reputation": 1117,
        "user_id": 1339087,
        "user_type": "registered",
        "accept_rate": 80,
        "profile_image": "https://www.gravatar.com/avatar/7b72123a28e4d5567e9d5f7f2b9b56ee?s=128&d=identicon&r=PG",
        "display_name": "Nikos",
        "link": "https://stackoverflow.com/users/1339087/nikos"
      },
      "is_answered": true,
      "view_count": 792,
      "closed_date": 1389895734,
      "accepted_answer_id": 21143805,
      "answer_count": 2,
      "score": 4,
      "last_activity_date": 1394125765,
      "creation_date": 1389783299,
      "last_edit_date": 1394125765,
      "question_id": 21135492,
      "link": "https://stackoverflow.com/questions/21135492/how-to-use-raml-to-describe-an-api-using-oauth2",
      "closed_reason": "off-topic",
      "title": "How to use RAML to describe an API using OAuth2"
    },
    {
      "tags": [
        "rest",
        "mule",
        "synchronous"
      ],
      "owner": {
        "reputation": 24,
        "user_id": 2292162,
        "user_type": "registered",
        "accept_rate": 57,
        "profile_image": "https://www.gravatar.com/avatar/b489ce0d53f928c09f419ee994cdc562?s=128&d=identicon&r=PG",
        "display_name": "Nathan Weddle",
        "link": "https://stackoverflow.com/users/2292162/nathan-weddle"
      },
      "is_answered": true,
      "view_count": 472,
      "accepted_answer_id": 21512926,
      "answer_count": 1,
      "score": 1,
      "last_activity_date": 1391620741,
      "creation_date": 1390862344,
      "last_edit_date": 1391620741,
      "question_id": 21393192,
      "link": "https://stackoverflow.com/questions/21393192/mule-rest-apikit-my-flow-isnt-returning-a-messge-body",
      "title": "Mule REST APIKit- My flow isn't returning a messge body"
    },
    {
      "tags": [
        "rest",
        "delete",
        "mule",
        "raml"
      ],
      "owner": {
        "reputation": 24,
        "user_id": 2292162,
        "user_type": "registered",
        "accept_rate": 57,
        "profile_image": "https://www.gravatar.com/avatar/b489ce0d53f928c09f419ee994cdc562?s=128&d=identicon&r=PG",
        "display_name": "Nathan Weddle",
        "link": "https://stackoverflow.com/users/2292162/nathan-weddle"
      },
      "is_answered": true,
      "view_count": 128,
      "accepted_answer_id": 21392361,
      "answer_count": 1,
      "score": 1,
      "last_activity_date": 1390859175,
      "creation_date": 1390856069,
      "last_edit_date": 1390859175,
      "question_id": 21391464,
      "link": "https://stackoverflow.com/questions/21391464/mule-esb-apikit-rest-delete-method-can-i-force-mule-to-use-the-json-body-instea",
      "title": "Mule ESB APIKit REST DELETE Method- Can I force Mule to use the JSON body instead of the URI?"
    }
  ],
  "has_more": false,
  "quota_max": 10000,
  "quota_remaining": 9950
}

(只有6个项和has_more属性为false)。

如果我使用堆栈溢出搜索:stackoverflow.com.raml.com.raml/search?q=raml%20 20rest

我现在得到了18个结果。

我是不是遗漏了什么?这个API方法是否有一定的局限性?

(我试图在这些论坛上找到类似的东西,但也找不到)。

EN

回答 1

Stack Apps用户

发布于 2014-07-26 05:28:09

/search路径和/search/advanced路径只返回问题,而不返回答案和精心设计。在文档页中是这样写的:

搜索站点中符合给定标准的任何问题。

此方法返回问题列表。

您的示例堆栈溢出搜索也返回了答案。

正确的等效搜索是:

stackoverflow.com/search?q=raml+rest+is%3Aquestion

--返回6个结果,与API相同。

好消息是,从2.2版开始,API提供了一个新的路由/search/excerpts,它也返回答案。

如果您使用用你的raml rest查询,您将看到它提供了18个结果--与堆栈溢出搜索相同。

票数 2
EN
页面原文内容由Stack Apps提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackapps.com/questions/4816

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档