Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4552

Date ranging with JSON QueryResponseWriter returns array of ints, not array of objects

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 4.0
    • None
    • Response Writers
    • None
    • Debian-based Linux OS, Jetty container, Java 1.7

    Description

      Faceting on a date range with the default XML QueryResponseWriter correctly gives the following output, which is easily parsable:
      <lst name="counts">
      <int name="2013-03-01T00:00:00Z">134755</int>
      <int name="2013-03-02T00:00:00Z">338759</int>
      <int name="2013-03-03T00:00:00Z">337118</int>
      <int name="2013-03-04T00:00:00Z">309487</int>
      </lst>

      However, the JSON QueryResponseWriter gives the following output, which conflates the field names and values and is thus not easily parsable:
      "counts": [
      "2013-03-01T00:00:00Z",
      134755,
      "2013-03-02T00:00:00Z",
      338754,
      "2013-03-03T00:00:00Z",
      337115,
      "2013-03-04T00:00:00Z",
      309482,
      ]

      I would expect the JSON QueryResponseWriter to give the following output, which is consistent with the XML QueryResponseWriter and is easily parsable:
      "counts": [

      {"2013-03-01T00:00:00Z":134755}

      ,

      {"2013-03-02T00:00:00Z":338754}

      ,

      {"2013-03-03T00:00:00Z":337115}

      ,

      {"2013-03-04T00:00:00Z":309482}

      ,
      ]

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dotancohen Dotan Cohen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: