lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Li <fancye...@gmail.com>
Subject Re: How to avoid the unexpected character error?
Date Fri, 16 Mar 2012 06:45:04 GMT
it's not the right place.
when you use java -Durl=http://... -jar post.jar data.xml
the data.xml file must be a valid xml file. you shoud escape special chars
in this file.
I don't know how you generate this file.
if you use java program(or other scripts) to generate this file, you should
use xml tools to generate this file.
but if you generate like this:
StringBuilder buf=new StringBuilder();
buf.append("<add>");
buf.append("<doc>");
buf.append("<field name="fname">text content</field>");
you should escape special chars.
if you use java, you can make use of org.apache.solr.common.util.XML class

On Fri, Mar 16, 2012 at 2:03 PM, neosky <neosky11@yahoo.com> wrote:

> I am sorry, but I can't get what you mean.
> I tried the  HTMLStripCharFilter and PatternReplaceCharFilter. It doesn't
> work.
> Could you give me an example? Thanks!
>
>  <fieldType name="text_html" class="solr.TextField"
> positionIncrementGap="100">
>   <analyzer>
>     <charFilter class="solr.HTMLStripCharFilterFactory"/>
>     <tokenizer class="solr.WhitespaceTokenizerFactory"/>
>   </analyzer>
>  </fieldType>
>
> I also tried:
>
> <charFilter class="solr.PatternReplaceCharFilterFactory" pattern="([^a-z])"
> replacement=""
>                 maxBlockChars="10000" blockDelimiters="|"/>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-avoid-the-unexpected-character-error-tp3824726p3831064.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message