title: ElasticSearch Multiple Scrolls Java API
body: <p>I want to get all data from an index. Since the number of items is too large for memory I use the Scroll (nice function):</p>
  
  <pre><code>client.prepareSearch(index)
      .setTypes(myType).setSearchType(SearchType.SCAN)
      .setScroll(new TimeValue(60000))
      .setSize(amountPerCall)
      .setQuery(MatchAll())
      .execute().actionGet();
  </code></pre>
  
  <p>Which works nice when calling: </p>
  
  <pre><code>client.prepareSearchScroll(scrollId)
      .setScroll(new TimeValue(600000))
      .execute().actionGet()
  </code></pre>
  
  <p>But, when I call the former method multiple times, I get the same <code>scrollId</code> multiple times, hence I cannot scroll multiple times - in parallel.</p>
  
  <p>I found <a href="http://elasticsearch-users.115913.n3.nabble.com/Multiple-scrolls-simultanious-td4024191.html" rel="nofollow">http://elasticsearch-users.115913.n3.nabble.com/Multiple-scrolls-simultanious-td4024191.html</a> which states that it is possible - though I don't know his affiliation to ES.</p>
  
  <p>Am I doing something wrong?</p>