active_fedora icon indicating copy to clipboard operation
active_fedora copied to clipboard

Finder method #find_in_batches applies :rows option incorrectly

Open dchandekstark opened this issue 11 years ago • 2 comments

:rows should be applied to the entire result set. Instead :rows limits the rows of each batch. This behavior causes unexpected results, for example, in find_each when a :rows option is used.

dchandekstark avatar Aug 26 '14 20:08 dchandekstark

This is complicated by the fact that rsolr's paginate method is supposed to raise an exception if passed a "rows" param -- specifically a string, not a symbol: https://github.com/rsolr/rsolr/blob/master/lib/rsolr/client.rb#L62. That may make sense for paginate, but doesn't make sense for AF methods that depend on find_in_batches.

dchandekstark avatar Aug 27 '14 01:08 dchandekstark

So it seems that find_each is the only method w/in AF that uses find_in_batches. How about using :limit instead of :rows for find_each?

dchandekstark avatar Aug 27 '14 01:08 dchandekstark