lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Klaas" <mike.kl...@gmail.com>
Subject Re: Doc add limit
Date Thu, 27 Jul 2006 22:11:01 GMT
On 7/27/06, Yonik Seeley <yonik@apache.org> wrote:

> class SolrConnection:
>   def __init__(self, host='localhost:8983', solrBase='/solr'):
>     self.host = host
>     self.solrBase = solrBase
>     #a connection to the server is not opened at this point.
>     self.conn = httplib.HTTPConnection(self.host)
>     #self.conn.set_debuglevel(1000000)
>     self.postheaders = {"Connection":"close"}
>
>   def doUpdateXML(self, request):
>     try:
>       self.conn.request('POST', self.solrBase+'/update', request,
> self.postheaders)

Disgressive note: I'm not sure if it is necessary with tomcat, but in
my experience driving solr with python using Jetty, it was necessary
to specify the content-type when posting utf-8 data:

self.postheaders.update({'Content-Type': 'text/xml; charset=utf-8'})

-Mike

Mime
View raw message