couchdbkit icon indicating copy to clipboard operation
couchdbkit copied to clipboard

AttributeError in ViewResults after Search with comma

Open stefankoegl opened this issue 14 years ago • 4 comments

When using Client.search() with a query-parameter that contains a comma (like q="some, string"), the iterator() method of the returned ViewResults object fails with an AttributeError

File "/usr/local/lib/python2.6/site-packages/couchdbkit-0.5.1-py2.6.egg/couchdbkit/client.py", line 825, in iterator
   rows = self._result_cache.get('rows', [])

AttributeError: 'list' object has no attribute 'get'

I'm using a current checkout of couchdb-lucene and a nearly-current (commit 2f3b58ec5874bf94b35ef21e161812828475fc16 ) checkout of couchdbkit.

stefankoegl avatar Feb 28 '11 09:02 stefankoegl

q response format is different from expected result in a view, wich means that now couchdb-lucene response need to be parsed differently. Support will be added as an extension soon.

benoitc avatar Feb 28 '11 13:02 benoitc

Is that already work-in-progress? If so, can I offer my help somehow?

stefankoegl avatar Mar 05 '11 09:03 stefankoegl

My idea is to have a Search object taking a db as argument and an optionnal backed so we can support different search solutions: couchdb-lucene, cloudant search and elasticsearch via couchdb river. Not sure I could do it before pycon, if you have sometimes to put in you're welcome :)

benoitc avatar Mar 05 '11 09:03 benoitc

I won't have time right now, but I might give it a shot during the next week. I'll let you know when I have something worth using.

stefankoegl avatar Mar 05 '11 09:03 stefankoegl