lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Carmalt <...@contact.de>
Subject Re: solr.py problems with german "Umlaute"
Date Thu, 06 Sep 2007 10:26:42 GMT
Hallo Christian,

Try it with title.encode('utf-8').
As in: kw = 
{'id':'12','title':title.encode('utf-8'),'system':'plone','url':'http://www.google.de'}


Christian Klinger schrieb:
> Hi all,
>
> i try to add/update documents with
> the python solr.py api.
>
> Everything works fine so far
> but if i try to add a documents which contain
> German Umlaute (ö,ä,ü, ...) i got errors.
>
> Maybe someone has an idea how i could convert
> my data?
> Should i post this to JIRA?
>
> Thanks for help.
>
> Btw: I have no sitecustomize.py .
>
> This is my script:
> ------------------------------------------------------
> from solr import *
> title="Übersicht"
> kw = 
> {'id':'12','title':title,'system':'plone','url':'http://www.google.de'}
> c = SolrConnection('http://192.168.2.13:8080/solr')
> c.add_many([kw,])
> c.commit()
> ------------------------------------------------------
>
> This is the error:
>
>   File "t.py", line 5, in ?
>     c.add_many([kw,])
>   File "/usr/local/lib/python2.4/site-packages/solr.py", line 596, in 
> add_many
>     self.__add(lst, doc)
>   File "/usr/local/lib/python2.4/site-packages/solr.py", line 710, in 
> __add
>     lst.append('<field name=%s>%s</field>' % (
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 
> 0: ordinal not in range(128)
>


Mime
View raw message