Method: Elasticsearch::API::Actions#clear_scroll

Defined in:
lib/elasticsearch/api/actions/clear_scroll.rb

#clear_scroll(arguments = {}) ⇒ Object

Clear a scrolling search. Clear the search context and results for a scrolling search.

*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, Array)

    A comma-separated list of scroll IDs to clear. To clear all scroll IDs, use ‘_all`. IMPORTANT: Scroll IDs can be long. It is recommended to specify scroll IDs in the request body parameter.

  • :error_trace (Boolean)

    When set to ‘true` Elasticsearch will include the full stack trace of errors when they occur.

  • :filter_path (String, Array<String>)

    Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch.

  • :human (Boolean)

    When set to ‘true` will return statistics in a format suitable for humans. For example `“exists_time”: “1h”` for humans and `“exists_time_in_millis”: 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines.

  • :pretty (Boolean)

    If set to ‘true` the returned JSON will be “pretty-formatted”. Only use this option for debugging only.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

See Also:



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/elasticsearch/api/actions/clear_scroll.rb', line 51

def clear_scroll(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'clear_scroll' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _scroll_id = arguments.delete(:scroll_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = '_search/scroll'
  params = Utils.process_params(arguments)

  if Array(arguments[:ignore]).include?(404)
    Utils.rescue_from_not_found do
      Elasticsearch::API::Response.new(
        perform_request(method, path, params, body, headers, request_opts)
      )
    end
  else
    Elasticsearch::API::Response.new(
      perform_request(method, path, params, body, headers, request_opts)
    )
  end
end