Method: OpenSearch::API::Actions#scroll

Defined in:
lib/opensearch/api/actions/scroll.rb

#scroll(arguments = {}) ⇒ Object

Allows to retrieve a large numbers of results from a single search request.

*Deprecation notice*: A scroll id can be quite large and should be specified as part of the body Deprecated since version 7.0.0

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :scroll_id (String)

    The scroll ID Deprecated

  • :scroll (Time)

    Specify how long a consistent view of the index should be maintained for scrolled search

  • :rest_total_hits_as_int (Boolean)

    Indicates whether hits.total should be rendered as an integer or an object in the rest search response

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The scroll ID if not passed by URL or query parameter.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/opensearch/api/actions/scroll.rb', line 44

def scroll(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _scroll_id = arguments.delete(:scroll_id)

  method = if arguments[:body]
             OpenSearch::API::HTTP_POST
           else
             OpenSearch::API::HTTP_GET
           end

  path = if _scroll_id
           "_search/scroll/#{Utils.__listify(_scroll_id)}"
         else
           "_search/scroll"
         end
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end