Method: Chewy::Search::Scrolling#scroll_wrappers
- Defined in:
- lib/chewy/search/scrolling.rb
#scroll_wrappers(batch_size: 1000, scroll: '1m') {|object| ... } ⇒ Object #scroll_wrappers(batch_size: 1000, scroll: '1m') ⇒ Enumerator
Iterates through the documents of the scope in batches. Yields each hit wrapped with Index.
90 91 92 93 94 95 96 |
# File 'lib/chewy/search/scrolling.rb', line 90 def scroll_wrappers(**) return enum_for(:scroll_wrappers, **) unless block_given? scroll_hits(**).each do |hit| yield loader.derive_index(hit['_index']).build(hit) end end |