0

一直在使用搜索 API,并在搜索结果中观察到一些奇怪的结果。

我知道今天有一场切尔西足球赛,所以我快速搜索了与切尔西相关的所有赛事:

(使用 Graph API 资源管理器@https ://developers.facebook.com/tools/explorer?

search?q=Chelsea&limit=5000&type=event&since=2013-04-28&until=2013-04-29

返回

{
  "data": [
    {
      "name": "Chelsea Jam Tree Comedy Competition Night", 
      "start_time": "2013-04-28T19:30:00+0100", 
      "timezone": "Europe/London", 
      "location": "The Jam Tree (Chelsea)", 
      "id": "201322573339969"
    }, 
    {
      "name": "Chelsea Basham at Fly By Night Club", 
      "start_time": "2013-04-27T19:00:00", 
      "end_time": "2013-04-27T22:00:00", 
      "location": "Fremantle, WA, AU", 
      "id": "119017388296997"
    }, 
    {
      "name": "The Chelsea & Alexis Show! with Special Friends", 
      "start_time": "2013-04-27T22:00:00-0400", 
      "timezone": "America/New_York", 
      "location": "Mark Fisher Fitness", 
      "id": "264038507064618"
    }
  ], 
  "paging": {
    "previous": "https://graph.facebook.com/search?q=Chelsea&limit=5000&since=1367173800&type=event&__paging_token=201322573339969", 
    "next": "https://graph.facebook.com/search?q=Chelsea&limit=5000&type=event&until=1367089200&__paging_token=119017388296997"
  }
}

好吧,不完全是我想要的——也许这个事件还没有被添加/被公开。

但是 - 如果我搜索(注意“切尔西”之前的 v)

search?q=v Chelsea&limit=5000&type=event&since=2013-04-28&until=2013-04-29

然后瞧 - 显示足球比赛。

{
  "data": [
    {
      "name": "Man United v Chelsea", 
      "start_time": "2013-04-28T16:00:00+0100", 
      "timezone": "Europe/London", 
      "location": "The Rising Sun, Hazel Grove", 
      "id": "518842844847325"
    }, 
    {
      "name": "FOOTBALL, Chelsea V Swansea City", 
      "start_time": "2013-04-28T15:00:00+0100", 
      "timezone": "Europe/London", 
      "location": "White Hart, Barnby Dun", 
      "id": "590753400942611"
    }, 
    {
      "name": "Chelsea V Swansea City", 
      "start_time": "2013-04-28T15:00:00+0100", 
      "timezone": "Europe/London", 
      "location": "Lizard Lounge - South Woodford", 
      "id": "281525378649440"
    }, 
    {
      "name": "Chelsea FC v Swansea", 
      "start_time": "2013-04-28T10:00:00-0400", 
      "end_time": "2013-04-28T12:00:00-0400", 
      "timezone": "America/Toronto", 
      "location": "Scallywags", 
      "id": "516466885084282"
    }, 
    {
      "name": "Chelsea v Swansea", 
      "start_time": "2013-04-28T15:00:00+0100", 
      "timezone": "Europe/London", 
      "location": "Stamford Bridge", 
      "id": "152203718287492"
    }, 
    {
      "name": "Chelsea v Swansea", 
      "start_time": "2013-04-28T19:00:00+0500", 
      "timezone": "Asia/Baku", 
      "location": "Stamford bridge, Fulham road, Лондон", 
      "id": "649119368438501"
    }, 
    {
      "name": "Chelsea v Swansea", 
      "start_time": "2013-04-28T09:30:00-0400", 
      "end_time": "2013-04-28T12:30:00-0400", 
      "timezone": "America/New_York", 
      "location": "Ireland's Four Courts", 
      "id": "404696952971017"
    }
  ], 
  "paging": {
    "previous": "https://graph.facebook.com/search?q=v Chelsea&limit=5000&since=1367161200&type=event&__paging_token=518842844847325", 
    "next": "https://graph.facebook.com/search?q=v Chelsea&limit=5000&type=event&until=1367155800&__paging_token=404696952971017"
  }
}

那么是 API 有问题,还是我做错了什么?

谢谢

4

1 回答 1

0

这是预期的行为。搜索“A”并不意味着您可以获得包含“A”字符的所有结果。搜索“A”并不意味着您可以获得“Apple”。数据库过于庞大,无法涵盖所有​​可能性。所以为了得到'Chelsea V',你必须给出'V'和'Chelsea'的关键词。否则想要回归“切尔西球场”、“切尔西球员”,一切可能?不,服务器处理的结果太大了。

于 2013-04-29T09:40:38.967 回答