From dff6350e5077b700a134ec1c24f547be31ea57b2 Mon Sep 17 00:00:00 2001 From: Ross Wilson Date: Thu, 22 Feb 2018 14:56:29 +0000 Subject: [PATCH] Limit should not be incremented when paging --- lib/elasticsearch/storage/data_stream.ex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/elasticsearch/storage/data_stream.ex b/lib/elasticsearch/storage/data_stream.ex index b7703b4..d08cd83 100644 --- a/lib/elasticsearch/storage/data_stream.ex +++ b/lib/elasticsearch/storage/data_stream.ex @@ -60,11 +60,10 @@ defmodule Elasticsearch.DataStream do [] -> {:halt, {[], offset, limit}} - # If the load returns items, then return the first item, and put the - # tail into the state. Also, increment offset and limit by the - # configured `:bulk_page_size`. + # If the load returns items, then return the first item, and put the tail + # into the state. Also, increment offset by the configured `:bulk_page_size`. [h | t] -> - {[h], {t, offset + page_size, limit + page_size}} + {[h], {t, offset + page_size, limit}} end end