0

将 LIMIT 选项添加到 FQL 会导致返回比没有 LIMIT 更多的结果。例如:

SELECT post_id, actor_id, message,description,type FROM stream WHERE source_id = me()

返回 4 个结果:

{ "data": [
{
  "post_id": "1458319848_4164228991531", 
  "actor_id": 1458319848, 
  "message": "Oh happy days!", 
  "description": null, 
  "type": 46
}, 
{
  "post_id": "1458319848_4081409841104", 
  "actor_id": 1458319848, 
  "message": "", 
  "description": "Caroline Natan and Or Karlinsky are now friends.", 
  "type": null
}, 
{
  "post_id": "1458319848_4076275592751", 
  "actor_id": 1458319848, 
  "message": "", 
  "description": "Caroline Natan changed her Interested In.", 
  "type": null
}, 
{
  "post_id": "1458319848_4075703458448", 
  "actor_id": 100001179537125, 
  "message": "", 
  "description": null, 
  "type": 237
}]}

但是使用:

SELECT post_id, actor_id, message,description,type FROM stream WHERE source_id = me() LIMIT 9

返回5 个结果:

{"data": [
{
  "post_id": "1458319848_4164228991531", 
  "actor_id": 1458319848, 
  "message": "Oh happy days!", 
  "description": null, 
  "type": 46
}, 
{
  "post_id": "1458319848_4081409841104", 
  "actor_id": 1458319848, 
  "message": "", 
  "description": "Caroline Natan and Or Karlinsky are now friends.", 
  "type": null
}, 
{
  "post_id": "1458319848_4076275592751", 
  "actor_id": 1458319848, 
  "message": "", 
  "description": "Caroline Natan changed her Interested In.", 
  "type": null
}, 
{
  "post_id": "1458319848_4075703458448", 
  "actor_id": 100001179537125, 
  "message": "", 
  "description": null, 
  "type": 237
}, 
{
  "post_id": "1458319848_4069875152744", 
  "actor_id": 100000876758120, 
  "message": "", 
  "description": null, 
  "type": 237
}]}

当然,这没有任何意义!我在这里错过了什么吗?如果有,是什么?我也读过这个,我没有看到关于这里描述的问题的任何内容。

提前致谢。

4

1 回答 1

1

The article you linked to actually addresses this issue:

You might notice that the number of results returned is not always equal to the “limit” specified. This is expected behavior. Query parameters are applied on our end before checking to see if the results returned are visible to the viewer. Because of this, it is possible that you might get fewer results than expected.

Which basically means that facebook filters the results after it executes the query.

In your example, in the first query, there's an implicit limit, say 5. Out of these 5 results, 1 is filtered out because of visibility restrictions and you get 4. In the second query, the server gets 10 results, filters 5 of them out based on visibility and returns 5 to you.

于 2012-08-14T13:07:46.533 回答