0

I am curious if I can control the results of a query so that it will not display the a particular field in the query. For instance...

query:

[{
  "id": null,
  "name": null,
  "type": "/people/person"
}]

result:

{
  "result": [
    {
      "type": "/people/person",
      "id": "/en/jack_abramoff",
      "name": "Jack Abramoff"
    },
    {
      "type": "/people/person",
      "id": "/en/bob_ney",
      "name": "Bob Ney"
    },...

I have tried this...

[{
  "id": null,
  "name": null,
  "type": [{
    "id": "/people/person",
    "limit": 0
  }]
}]

Which gives me ...

{
  "result": [
    {
      "type": [],
      "id": "/en/jack_abramoff",
      "name": "Jack Abramoff"
    },
    {
      "type": [],
      "id": "/en/bob_ney",
      "name": "Bob Ney"
},...

I am wondering if there is a way to just get this

{
  "result": [
    {
      "id": "/en/jack_abramoff",
      "name": "Jack Abramoff"
    },
    {
      "id": "/en/bob_ney",
      "name": "Bob Ney"
    },...
4

1 回答 1

1

不,没有办法做到这一点。你为什么需要这样做?一旦您在应用程序中解析 JSON 数据,就很容易忽略任何您不需要的值。API 支持使用 gzip 压缩,因此您也不必担心响应大小。如果您真的在优化速度,您可能会考虑切换到如下所示的Search API

https://www.googleapis.com/freebase/v1/search?filter=(all+type:/people/person) 
于 2013-10-23T17:25:41.413 回答