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

Broken JSON indentation using JacksonJsonWriter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 9.3
    • 9.4
    • Response Writers
    • None
    • Problem reproduces across 6+ SolrCloud clusters.

    Description

      I'm seeing some very weird formatting using the default interface query output in SolrCloud mode. Either all the indented content is shifted by many white spaces (while keeping indents after this), either there is not indenting at all (keeping multiple lines, different from indent=false), either we get a new line between every line.

      I believe it's a bug from the combination of the JacksonJsonWriter and indent=true. The Query component of the interface is quite an important feature for debugging.
      The workaround was to add <queryResponseWriter name="json" class="solr.JSONResponseWriter" /> and <str name="wt">json</str> to the defaults on the /select SearchHandler, as it seems when not specifying a default wt it defaults to the JacksonJsonWriter and not JSONResponseWriter.

      Attachments

        Issue Links

          Activity

            People

              houston Houston Putman
              dizzu333 Ovidiu Mihalcea
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h