Try changing your solrconfig.xml. Look for the following:
<queryResponseWriter name="json" class="solr.JSONResponseWriter">
<!-- For the purposes of the tutorial, JSON responses are written as
plain text so that they are easy to read in *any* browser.
If you expect a MIME type of "application/json" just remove this override.
-->
<str name="content-type">text/plain; charset=UTF-8</str>
</queryResponseWriter>
See if you have any luck changing that to application/json. The driving reason
for this text/plain default is those newlines allow the browser to display a
more formatted response to the user.
Trappy default for standard use unfortunetly.
- Mark
On Jan 23, 2014, at 9:20 AM, stevenNabble <[email protected]> wrote:
> Hello,
>
> I am finding that if any fields in a document returned by a Solr query
> (*wt=json* to get a JSON response) contain backslash *'\'* characters, they
> are not being escaped (to make then valid JSON).
>
> e.g. Solr returns this: 'A quoted value *\"XXX\"*, plus these are
> backslashes *\r\n* which should be escaped but aren't :-('
>
> Any ideas? I shouldn't need to escape these values before submitting to the
> Solr index but I can't see any other way at the moment...
>
> Regards
> Steven
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-solr-JSONResponseWriter-not-escaping-backslash-characters-tp4112990.html
> Sent from the Solr - User mailing list archive at Nabble.com.