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

TextResponseWriter/XMLWriter: Make escaping deactivatable

    XMLWordPrintableJSON

Details

    Description

      Since we have full control over what is stored in our indexes, we want to retrieve highlighted terms or phrases in "real" XML-tags ...

      <str>
       <em>Napoleon</em> 
      </str>
      

      ... rather than in escaped sequences:

      <str>
       &lt;em&gt;Napoleon&lt;/em&gt; 
      </str>
      

      Until now I haven't discovered any solution to solve this problem out-of-the-box. We patched together a very crude workaround involving Cocoon's ServletService, a XSLT-stylesheet and disableOutputEscaping="yes".

      Therefore this patch provides:

      • a field doEscape in TextResponseWriter and corresponding getters/setters
      • support for a request-parameter "escape=off" to disable escaping

      I'm not sure if I have chosen the optimal approach to address this issue or if the issue is even a issue. Maybe there is a better way with Formatters/Encoders or something else?

      Attachments

        1. disable_escape.patch
          3 kB
          Sebastian Lutze
        2. disable_escape.patch
          3 kB
          Sebastian Lutze

        Activity

          People

            Unassigned Unassigned
            mdz-munich Sebastian Lutze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: