params not included in next_batch
What steps will reproduce the problem?
1. res = s.select(keyword, fields='id,pubDate')
2. res = res.next_batch()
What is the expected output? What do you see instead?
1. solr => path=/select params={fl=id,pubDate,score ...
2. solr => path=/select params={fl=*,score ...
(2) missing field list param
What version of the product are you using? On what operating system?
solrpy-0.9.4, Windows
Please provide any additional information below.
Original issue reported on code.google.com by [email protected] on 6 Apr 2011 at 9:44
The problem is that the 'fields' argument to SearchHandler.__call__ gets
renamed to 'fl'. So this would be fixed by inserting the following into that
method:
fields = params.pop('fl', fields)
Original comment by [email protected] on 28 Oct 2012 at 5:46
This monkey-patch works:
import solr
old_call = solr.core.SearchHandler.__call__
def new_call(self, q=None, fields=None, *args, **params):
print 'in new_call'
fields = params.pop('fl', fields)
return old_call(self, q, fields, *args, **params)
solr.core.SearchHandler.__call__ = new_call
Original comment by [email protected] on 1 Nov 2012 at 6:43
I'm having this problem too.
next_batch() also loses the "score" parameter from the original search, so it ends up defaulting to "True". The monkey-patch kinda works for me, but I had to add
score=False
Is this related at all to #36? If someone has time to send a pull request I can merge it in and release it.
If it means anything, I had this same issue in both versions for python 2 and 3. I actually ran a performance test on my data to show the difference it made and verify the problem. The monkey patch worked perfectly.
