Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: search
    • Labels:
      None

      Description

      Here is the JSON response writer, along with subclasses for Python and Ruby.
      Python: use None for null, True/False for boolean, use unicode strings where necessary
      Ruby: use single quoted strings to avoid security issues, use => as map separator

      Patch and examples to follow, comments sought.

      1. example.txt
        13 kB
      2. json.diff
        46 kB
        Yonik Seeley

        Activity

        Hide
        Yonik Seeley added a comment -

        Some implementation notes:

        • There is a base class for all text-oriented writers, TextResponseWriter... it is meant to be generic enough to allow things like JSON or XML output (hence the name parameter for primitives like writeInt() even though the name is unused in the primitive methods for JSON).
        • The FieldType hierarchy gains a new method:
          public void write(TextResponseWriter writer, String name, Fieldable f)
        • I left the existing XML writer methods on FieldType alone for now... a future patch could easily implement the XMLWriter in terms of TextResponseWriter and deprecate the existing FieldType.write(XMLWriter...) methods.
        • the style of output for NamedList (a single map, or an array or 2 element arrays) is selectable via the parameter "json.nl"... current values are "map", "arrmap", "arrarr"
        Show
        Yonik Seeley added a comment - Some implementation notes: There is a base class for all text-oriented writers, TextResponseWriter... it is meant to be generic enough to allow things like JSON or XML output (hence the name parameter for primitives like writeInt() even though the name is unused in the primitive methods for JSON). The FieldType hierarchy gains a new method: public void write(TextResponseWriter writer, String name, Fieldable f) I left the existing XML writer methods on FieldType alone for now... a future patch could easily implement the XMLWriter in terms of TextResponseWriter and deprecate the existing FieldType.write(XMLWriter...) methods. the style of output for NamedList (a single map, or an array or 2 element arrays) is selectable via the parameter "json.nl"... current values are "map", "arrmap", "arrarr"
        Hide
        Yonik Seeley added a comment -

        Date Types: there are no native date types in Ruby or Python to my knowledge (that need no import), so they are currently represented as a string. A future option could allow dates to be written differently, such as the number of milliseconds since the UNIX epoch... that might make it much easier to construct native date objects.

        Show
        Yonik Seeley added a comment - Date Types: there are no native date types in Ruby or Python to my knowledge (that need no import), so they are currently represented as a string. A future option could allow dates to be written differently, such as the number of milliseconds since the UNIX epoch... that might make it much easier to construct native date objects.
        Hide
        Yonik Seeley added a comment -

        fixed returnedField list handling, including score field, committed.

        Show
        Yonik Seeley added a comment - fixed returnedField list handling, including score field, committed.
        Hide
        Hoss Man added a comment -

        This bug was modified as part of a bulk update using the criteria...

        • Marked ("Resolved" or "Closed") and "Fixed"
        • Had no "Fix Version" versions
        • Was listed in the CHANGES.txt for 1.1

        The Fix Version for all 38 issues found was set to 1.1, email notification
        was suppressed to prevent excessive email.

        For a list of all the issues modified, search jira comments for this
        (hopefully) unique string: 20080415hossman3

        Show
        Hoss Man added a comment - This bug was modified as part of a bulk update using the criteria... Marked ("Resolved" or "Closed") and "Fixed" Had no "Fix Version" versions Was listed in the CHANGES.txt for 1.1 The Fix Version for all 38 issues found was set to 1.1, email notification was suppressed to prevent excessive email. For a list of all the issues modified, search jira comments for this (hopefully) unique string: 20080415hossman3

          People

          • Assignee:
            Yonik Seeley
            Reporter:
            Yonik Seeley
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development