Skip to content

Sunburnt not compatible with newer versions of Solr XML output #52

@kopf

Description

@kopf
>>> import httplib2, sunburnt
>>> h = httplib2.Http()
>>> si = sunburnt.SolrInterface('http://localhost:8983/solr/items', http_connection=h)
>>> si.query(identifier='16dhnwtakze4po5x').execute()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/aengus/.virtualenvs/mini_itemsearch/local/lib/python2.7/site-packages/sunburnt/search.py", line 599, in execute
    result = self.interface.search(**self.options())
  File "/home/aengus/.virtualenvs/mini_itemsearch/local/lib/python2.7/site-packages/sunburnt/sunburnt.py", line 213, in search
    return self.schema.parse_response(self.conn.select(params))
  File "/home/aengus/.virtualenvs/mini_itemsearch/local/lib/python2.7/site-packages/sunburnt/schema.py", line 510, in parse_response
    return SolrResponse(self, msg)
  File "/home/aengus/.virtualenvs/mini_itemsearch/local/lib/python2.7/site-packages/sunburnt/schema.py", line 646, in __init__
    details['responseHeader'] = dict(details['responseHeader'])
KeyError: 'responseHeader'

This is with solr 2.4.0. It is caused by the fact that when Sunburnt makes this call, it calls: http://localhost:8983/solr/items/select/?q=identifier%3A16dhnwtakze4po5x . This returns data using <responseHeader> tags, instead of between <lst name="responseHeader"></lst>

Specifying a version of 2.2 functions as a work-around

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions