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

ExportHandler does not escape special Characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.10.3
    • None
    • None
    • None

    Description

      We use Solr 4.10.3 and have configured an /export SearchHandler in addition to the default SearchHandler /select.

      The handler follows the example from section "Exporting Result Sets" of the Solr user guide (v4.10).

       <requestHandler name="/export" class="solr.SearchHandler">
         <lst name="invariants">
           <str name="rq">{!xport}</str>
           <str name="wt">xsort</str>
           <str name="distrib">false</str>
           <str name="fl">username,description</str>
          </lst>
         <arr name="components">
           <str>query</str>
         </arr>
       </requestHandler>
      

      The description field may contain line breaks (\n) and quotation marks (").

      When using the /select handler those characters are properly escaped. E.g. we get following value in the response:

      "description":"Lorem ipsum\n\ndolor sit amet. \"hello\" world \" test....",
      

      BUT when using the /export handler those characters are NOT escaped. We
      get:

       "description":"Lorem ipsum
      
       dolor sit amet. "hello" world " test...."
      

      The latter is not valid JSON in our understanding.

      Attachments

        Activity

          People

            jbernste Joel Bernstein
            s.kiesewetter Sven Kiesewetter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: