You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Elaine Li <el...@gmail.com> on 2009/08/31 20:05:07 UTC

Why can't have & sign in the text?

Hi,

I use text as my field type, but whenever my field has '&' sign, the
post.jar will error out. What can I do to work around this? Thanks.

solr returned an error:
comctcwstxexcWstxLazyException_Unexpected_character___code_32_missing_name__
at_javaxxmlstreamSerializableLocation587f587f__comctcwstxexcWstxLazyException_comctcwstxexcWstxUnexpectedCharException_
Unexpected_character___code_32_missing_name__
at_javaxxmlstreamSerializableLocation587f587f__
at_comctcwstxexcWstxLazyExceptionthrowLazilyWstxLazyExceptionjava45__
at_comctcwstxsrStreamScannerthrowLazyErrorStreamScannerjava729__
at_comctcwstxsrBasicStreamReadersafeFinishTokenBasicStreamReaderjava3659__
at_comctcwstxsrBasicStreamReadergetTextBasicStreamReaderjava809__
at_orgapachesolrhandlerXmlUpdateRequestHandlerreadDocXmlUpdateRequestHandlerjava327__
.........

<fieldType name="mytext" class="solr.TextField" >
      <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
    </fieldType>

Please advise.

Elaine

Re: Why can't have & sign in the text?

Posted by Elaine Li <el...@gmail.com>.
Thanks a lot! Really helped.



On Mon, Aug 31, 2009 at 2:21 PM, AHMET ARSLAN<io...@yahoo.com> wrote:
>> I use text as my field type, but whenever my field has
>> '&' sign, the post.jar will error out. What can I do to work around this?
>> Thanks.
>
> The files - that you are posting - must be valid xml. Escape special xml characters, e.g. replace & with &
>
>
>
>
>

Re: Why can't have & sign in the text?

Posted by AHMET ARSLAN <io...@yahoo.com>.
> I use text as my field type, but whenever my field has
> '&' sign, the post.jar will error out. What can I do to work around this?
> Thanks.

The files - that you are posting - must be valid xml. Escape special xml characters, e.g. replace & with &amp;