title: logstach: jdbc_page_size doesn't dump all my data to elastic search
body: <p>I'd like to export tom_test2 postgresql table to elastic search. The table has 176805 rows:</p>
  
  <pre><code>=&gt; select count(*) from tom_test2;
   count  
  --------
   176805
  (1 row)
  </code></pre>
  
  <p>The following logstach conf file import correctly my data to elastic search:</p>
  
  <pre><code>input {
      jdbc {
          # Postgres jdbc connection string to our database, mydb
          jdbc_connection_string =&gt; "xxx"
          # The user we wish to execute our statement as
          jdbc_user =&gt; "xxx"
          jdbc_password =&gt; "xxx"
          # The path to our downloaded jdbc driver
          jdbc_driver_library =&gt; "xxx"
          # The name of the driver class for Postgresql
          jdbc_driver_class =&gt; "org.postgresql.Driver"
          # our query
          statement =&gt; "select * from tom_test2"
      }
  }
  
  
  output {
      elasticsearch {
          hosts =&gt; ["xxx"]
          index =&gt; "tom"
          document_type =&gt; "tom_test"
      }
  }
  </code></pre>
  
  <p>In elastic search:</p>
  
  <pre><code>GET tom/tom_test/_search
  
    "hits": {
      "total": 176805,
      "max_score": 1,
  }
  </code></pre>
  
  <p>I'm deleting my index in elastic search:</p>
  
  <pre><code>delete tom
  </code></pre>
  
  <p>And I now would like to do the same operation using jdbc_page_size in case my data becomes bigger, my logstach conf file is now:</p>
  
  <pre><code>input {
      jdbc {
          # Postgres jdbc connection string to our database, mydb
          jdbc_connection_string =&gt; "xxx"
          # The user we wish to execute our statement as
          jdbc_user =&gt; "xxx"
          jdbc_password =&gt; "xxx"
          # The path to our downloaded jdbc driver
          jdbc_driver_library =&gt; "xxx"
          # The name of the driver class for Postgresql
          jdbc_driver_class =&gt; "org.postgresql.Driver"
          # our query
          statement =&gt; "select * from tom_test2"
  
          jdbc_page_size =&gt; 1000
          jdbc_paging_enabled =&gt; true
      }
  }
  
  
  output {
      elasticsearch {
          hosts =&gt; ["xxx"]
          index =&gt; "tom"
          document_type =&gt; "tom_test"
      }
  }
  </code></pre>
  
  <p>My count is now wrong:</p>
  
  <pre><code>GET tom/tom_test/_search
  
    "hits": {
      "total": 106174,
      "max_score": 1,
  }
  </code></pre>
  
  <p>as 176805-106174=70631 rows are missing</p>