对象

时间:2016-03-28 16:39:30

标签: json apache solr

我正在查看实现solr查询的Data.gov。当我使用测试搜索时:

  

http://catalog.data.gov/api/3/action/package_search?fq=crime

我在资源数组中看到对象中有字段:

    resources: [
       {
          resource_group_id: "8803cac0-41c0-4df9-9c1a-b6bf1be234d6",
          cache_last_updated: null,
          revision_timestamp: "2015-04-16T07:26:28.750291",
          webstore_last_updated: null,
          id: "4c948605-0db4-45e8-9c06-c851f05f9f37",
          size: null,
          state: "active",
          hash: "",
          description: "",
          format: "CSV",
             tracking_summary: {
             total: 7893,
             recent: 294
          },
          mimetype_inner: null,
          revision_id: "baaab1e5-d3da-493c-9459-13a250a8c8fc",
          mimetype: "text/csv",
          cache_url: null,
          name: "Comma Separated Values File",
          created: "2015-02-04T14:39:09.238366",
          url: "https://data.cityofchicago.org/api/views/ijzp-q8t2/rows.csv?accessType=DOWNLOAD",
          webstore_url: null,
          last_modified: null,
          position: 0,
          no_real_name: true,
          resource_type: null
       },

有没有办法根据返回的对象中的字段进行过滤?例如,假设我只想格式化格式为" CSV"回来。我该如何构建该查询?

我试图做这些事情无济于事:

fq=filter:CSV
fq=filter:'CSV'
fq=resources.filter:'CSV'
fq=resources[* TO *].filter:'CSV'
fq=resources{filter:'CSV'}

我一直试图在示例中找到正确的模式,但遇到了问题。

0 个答案:

没有答案