Elastic v2.6.1 Elastic.Scroller

Provides an API for working with Elastic Search’s Scroll API

Example

{:ok, pid} = Elastic.Scroller.start_link(%{index: "answer"})
# get the first "page" of results
Elastic.Scroller.results(pid)
# Request the second page
Elastic.Scroller.next_page(pid)
# get the second "page" of results
Elastic.Scroller.results(pid)

Then you can choose to kill the search context yourself… keeping in mind of course that Elastic Search will do this automatically after the keepalive (default of 1 minute) expires for the scroll.

Elastic.Scroller.clear(pid)

Summary

Functions

Fetches the next page of results and returns a scroll ID

Returns the results of the current scroll location

Starts an Elastic.Scroller server

Functions

next_page(pid)
next_page(pid) ::
  {:ok, String.t} |
  {:error, :search_context_not_found, map} |
  {:error, String.t}

Fetches the next page of results and returns a scroll ID.

To retrieve the results that come from this request, make a call to Elastic.Scroller.results/1.

Elastic.Scroller.next_page(pid)
results(pid)
results(pid) :: [map]

Returns the results of the current scroll location.

Elastic.Scroller.results(pid)
start_link(map)
start_link(%{:index => String.t, optional(:body) => map, optional(:size) => pos_integer, optional(:keepalive) => String.t}) :: {:ok, pid}

Starts an Elastic.Scroller server.

For usage information refer to the documentation at the top of this module.