Hi

i just play a bit with:
http://svn.apache.org/repos/asf/lucene/solr/trunk/client/python/solr.py

Is it possible that this library is a bit out of date?


If i try to get the example running. I got a parese error from the result. Maybe the response format form Solr has changed?

If you can have a look at this method

  def doUpdateXML(self, request):
    try:
      rsp = self.doPost(self.solrBase+'/update', request, self.xmlheaders)
      data = rsp.read()
    finally:
      if not self.persistent: self.conn.close()
    #fast path... don't parse XML if we recognize response as success
    if not data.startswith('<result status="0"'):
      data = self.decoder(data)[0]
      d = parseString(data)
      status = d.documentElement.getAttribute('status')
      if status!=0:
        reason = d.documentElement.firstChild.nodeValue
        raise SolrException(rsp.status, status, reason)
    return data

It checks if the status != 0.

data = <?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">4</int></lst>
</response>

status =  ""

-Chrisitan

Reply via email to