Method: Elasticated::Repository::ResumableSearch#fetch

Defined in:
lib/elasticated/repository/resumable_search.rb

#fetchObject



30
31
32
33
34
35
36
37
38
# File 'lib/elasticated/repository/resumable_search.rb', line 30

def fetch
  raise "No scroll_id present" unless scroll_id
  raise "No more information to fetch: scroll completed" if completed?
  response = client.scroll scroll_id, scroll: scroll_expiration_time
  results = parse_and_prepare_results response
  self.scroll_id = results.scroll_id
  mark_completed! if results.documents.empty?
  results
end