toastdriven/pysolr — pull request #127 by maikhoepfel (2014-08-24 12:32:11+00:00)
Title: Don't try to convert response to bytes

Haystack passes facet queries unfiltered to pysolr. If I use a query string that both contains a wrong field name and a unicode char, e.g. ``?selected_facets=price_eact%3A%5B%D0%90+TOOO+%D0%91%5D``, Solr returns the following error response:

```
'{"responseHeader":{"status":400,"QTime":2,"params":{"facet.query":["price_exact:[0 TO 20]","price_exact:[20 TO 40]","price_exact:[40 TO 60]","price_exact:[60 TO *]"],"q":"*:*","facet.field":["product_class_exact","rating_exact"],"spellcheck":"true","fl":"* score","start":"0","spellcheck.count":"1","fq":["price_eact:(\\"\\\\[\xd0\x90 TOOO \xd0\x91\\\\]\\")","django_ct:(catalogue.product)"],"rows":"1","facet":"on","wt":"json","spellcheck.collate":"true"}},"error":{"msg":"undefined field price_eact","code":400}}\n'
```

Now I don't know why the JSON response isn't parsed correctly. But it definitely shouldn't fail on the unicode string, which my change achieves. But it avoids the UnicodeDecodeError that is otherwise triggered: https://dpaste.de/eGRi