Carrage Returns in XML Results

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Carrage Returns in XML Results

Mike Davies-2-3
Hi,

I'm having a small problem with Solr, have had a good look for solutions on
the web but nothing so far.  Apologies if this has been asked before.

I am indexing a text field to contain a text article, this article has some
line feeds and CR's in it.  I can index the field OK and if I look at the
Lucene index using Luke I can see that the CR + LF are being stored
correctly in the index, however, when I get the document back from Solr in
XML, the CR + LF's are missing.

Is there a way I can tell Solr to return the text as it appears in the
index, including the CR + LF's?

Thanks in advance

Mike
Reply | Threaded
Open this post in threaded view
|

Re: Carrage Returns in XML Results

Mike Davies-2-3
Have resolved the problem.

Turns out it was not a problem with Solr but with SolrSharp, before loading
the XML stream into the parser it was removing all \n's from the server
response.

I've disabled this line and everything seems to be working now.

For anyone's future reference, change the following line in G
etXmlDocumentFromPost()

From:
xdoc.LoadXml(sr.Replace("\n", ""));

To:
xdoc.LoadXml(sr);

Cheers

Mike

On Feb 6, 2008 12:54 PM, Mike Davies <[hidden email]> wrote:

> Hi,
>
> I'm having a small problem with Solr, have had a good look for solutions
> on the web but nothing so far.  Apologies if this has been asked before.
>
> I am indexing a text field to contain a text article, this article has
> some line feeds and CR's in it.  I can index the field OK and if I look at
> the Lucene index using Luke I can see that the CR + LF are being stored
> correctly in the index, however, when I get the document back from Solr in
> XML, the CR + LF's are missing.
>
> Is there a way I can tell Solr to return the text as it appears in the
> index, including the CR + LF's?
>
> Thanks in advance
>
> Mike
>