app/models/spotlight/search.rb in blacklight-spotlight-3.5.0.4 vs app/models/spotlight/search.rb in blacklight-spotlight-3.6.0.beta1

- old
+ new

@@ -43,17 +43,17 @@ return unless thumbnail&.iiif_url thumbnail.iiif_url end - def documents + def documents(&block) start = 0 response = repository.search(search_params.start(start)) return to_enum(:documents) { response['response']['numFound'] } unless block_given? while response.documents.present? - response.documents.each { |x| yield x } + response.documents.each(&block) start += response.documents.length response = repository.search(search_params.start(start)) end end