Method: Elasticsearch::API::Actions#scroll
- Defined in:
- lib/elasticsearch/api/actions/scroll.rb
#scroll(arguments = {}) ⇒ Object
Efficiently iterate over a large result set.
When using ‘from` and `size` to return a large result sets, performance drops as you “paginate” in the set, and you can’t guarantee the consistency when the index is being updated at the same time.
The “Scroll” API uses a “point in time” snapshot of the index state, which was created via a “Search” API request specifying the ‘scroll` parameter.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/elasticsearch/api/actions/scroll.rb', line 52 def scroll(arguments={}) method = HTTP_GET path = "_search/scroll" valid_params = [ :scroll, :scroll_id ] params = Utils.__validate_and_extract_params arguments, valid_params body = arguments[:body] || params.delete(:scroll_id) perform_request(method, path, params, body).body end |