lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "XMLResponseFormat" by scottchu
Date Fri, 23 Nov 2012 09:27:10 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "XMLResponseFormat" page has been changed by scottchu:
http://wiki.apache.org/solr/XMLResponseFormat?action=diff&rev1=13&rev2=14

  The default behavior is not to indent.
  
  == 'newline/line break character' ==
- When your output contains newline character (Windows = CRLF, Linux=LF, MAC=CR as far as
we know), the xml output in browser won't show line break effect. If you select 'view source',
you can see there're indeed line break, though, i.e. Solr doesn't affect stored data). For
other writer types, such as php, json, csv ,etc, they don't have this problem (json writer
type even escapes newline). People normally read data from solr and show html page, if this
is your request, you can use regular expression to replace newline with <br> tag, e.g.
value.replaceWith("/\r\n/", "<br>").replaceWith("/(?!\r")\n/","<br>").replaceWith("/\r(?!\n)/","<br>").
Adapt the syntax to the language you use before you execute this statement.
+ When your output contains newline character (Windows = CRLF, Linux=LF, MAC=CR as far as
we know), the xml output in browser won't show line break effect. If you select 'view source',
you can see there're indeed line break, though, i.e. Solr doesn't affect stored data). For
other writer types, such as php, json, csv ,etc, they don't have this problem (json writer
type even escapes newline). People normally read data from solr and show html page, if this
is your request, you can use regular expression to replace newline with <br> tag, e.g.
value.replaceWith("/\r\n/", "<br>").replaceWith("/(?!\r)\n/","<br>").replaceWith("/\r(?!\n)/","<br>").
Adapt the syntax to the language you use before you execute this statement.
  
  ----
  CategoryQueryResponseWriter

Mime
View raw message