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

リンク先の記事では、実際にこの問題に対処しています。

返される結果の数が、指定された「制限」と常に等しいとは限らないことに気付くかもしれません。これは予期される動作です。クエリ パラメーターは、返された結果が視聴者に表示されるかどうかを確認する前に、我々 側で適用されます。このため、予想よりも少ない結果が得られる可能性があります。

これは基本的に、Facebook がクエリを実行した後に結果をフィルタリングすることを意味します。

あなたの例では、最初のクエリでは、5 などの暗黙の制限があります。これらの 5 つの結果のうち、可視性の制限のために 1 が除外され、4 を取得します。2 番目のクエリでは、サーバーは 10 の結果を取得し、5 をフィルタリングしますそれらは可視性に基づいて除外され、5 が返されます。

于 2012-08-14T13:07:46.533 に答える