View Source OffBroadway.Elasticsearch.ScrollStrategy (OffBroadwayElasticsearch v0.1.0)

Implementation of OffBroadway.Elasticsearch.Strategy that uses the "Scroll" feature of Elasticsearch. This strategy is best suited for a single producer, fetching less than 10,000 results per request. For concurrent searching, see OffBroadway.Elasticsearch.SliceStrategy and for searching with demand greater than 10,000 see OffBroadway.Elasticsearch.SearchAfterStrategy

Example

defmodule MyBroadway do
  use Broadway

  def start_link(_opts) do
    Broadway.start_link(__MODULE__,
      ...
      producer: [
        module: {
          OffBroadway.Elasticsearch.Producer,
          [
            host: "http://localhost:9200",
            index: "my-index",
            strategy: :scroll, # <- Select the 'scroll' strategy
            search: search() # <- Provide a search query
          ]
        },
        concurrency: 1 # <- A single process to manage 'scrolling'
      ],
      ...
    )
  end
end

See Elasticsearch docs: Scroll Search

Summary

Types